Creating and sending a packet via a socket

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nitheshsalian
    New Member
    • Mar 2008
    • 9

    #1

    Creating and sending a packet via a socket

    I have created a Packet as a structure. i am not able to send the packet through the send() because what i have understood it sends only strings. Is there any way to send the packet as a structure itself??
    Basically i want to know how to send a packet via socket connection?
  • dazzler
    New Member
    • Nov 2007
    • 75

    #2
    Originally posted by nitheshsalian
    I have created a Packet as a structure. i am not able to send the packet through the send() because what i have understood it sends only strings. Is there any way to send the packet as a structure itself??
    Basically i want to know how to send a packet via socket connection?
    hmmh, try using pickle module , google for it ;)

    pickle the data, which converts it to string and then send it. and the receiver can unpickle it then from the string... I don't have tried pickle but I think that it might work like that

    Comment

    Working...