URG: Help need in socket programming
Magnus
me at privacy.net
Fri May 30 05:06:59 EDT 2003
Vijay Anand R. wrote:
> hai
>
> can any help me in solving my problem with python sockets?
>
>
> i am involved in testing the functionality of a financial exchange soln
> named STRIDE. it uses FIX protocol
>
> i am using non blocking sockets. i find some problems while sending the
> invalid testcases. the test case that have appln based error gets rejected
> by the STRIDE and i am able to receive the error message. but when i send
> test cases with improper data format, the FIX gateway rejects it. but i am
> not able to capture the error. my testing tool gets hanged. i am running
> using IDLE.
>
> this is my code - can anyone help me in this regard
>
>
>
> def sendMsg(user,port,msg,login):
>
> global signUser, sock, fNameCount
>
> if login == 1:
> lNMsg = 1
> else:
> lNMsg = 2
> dump = ''
> count = 0
> while 1:
> count = count + 1
> data = sock[user].recv(BUFSIZ)
> dump = dump + data
>
> if login == 1:
> signUser[user] = getSign(data)
>
> if not data or count >= lNMsg : break
>
> return dump
>
>
>
>
> regards
>
> R Vijay Anand
>
> Project Trainee, Elind Computer Pvt Ltd,
> 100 Feet Road, HAL 2nd Stage,Indiranagar,
> Bangalore 560038. INDIA
> Tel : 080 5216767 Extn : 290
>
> "It's easier to put on slippers than to carpet the whole world."
I don't understand what you are trying to achieve?
Though I noticed your function is called *sendMessage* but you do a *recv*
can this be a problem?
More information about the Python-list
mailing list