how to transfer integer on socket?

Frank Potter could.net at gmail.com
Sat Apr 21 04:48:58 CEST 2007


Is there any easy way to transfer 4 bit integer on socket?

I want to send like this:

a=5
send_integer(socket_s,a)

and receive like this:
a=receive_integer(socket_s)

Sending and receiving is in binary form, not transfer it to string.
Is there any easy way to do this?




More information about the Python-list mailing list