[Tutor] Need help!
alan.gauld at btinternet.com
Sat Dec 13 00:23:28 CET 2014
On 12/12/14 12:46, Jagannath Ramanan wrote:
> vncserver running at the background in redhat. My client is lubuntu where
> im using python.
> For some reason the communication is only possible between them is to send
> custom TCP/IP messages.
What makes you think so?
Is that something you have been told?
Is it a technical requirement of your project?
Have you tried communicating in any other way
- eg. ping, ftp, ssh, http etc/
Also does it need to be TCP/IP? Could it be UDP over IP instead?
If the messages are simple UDP can sometimes be easier to work with.
> *The TCP /IP message length is:*
> TCP/IP: 37 bytes of message + 16 bytes of header = 53 bytes Raw Serial: 37
> bytes message + 16 bytes of header + 2 bytes of trailer = 55 bytes
> I have no idea how i would code something like that in python to make it
> talk to the server.
It may be possible but it's well beyond the scope of learning Python
and its library. You are probably better asking on the main python
list. Assuming you really must go down this path of course.
You might want to find a copy of "Foundations of Python Network
Programming" by Goertzen. It's probably the best reference for
networking on Python. But even he doesn't discuss creating
bespoke packets which is what you seem to be asking about.
The other classic text is Richard Steven's book(s)
"Unix Network Programming: Sockets Networking API v.1"
It's aimed at C programmers and very low level but for what you
want it may be the best bet.
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:
More information about the Tutor