#1
  1. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154

    Socket Recv Definition


    I was just wondering if a socket could receive a definition. For example,
    Code:
    def data():
        data
        info
        etc.
    This would be the definition (just an example) and I would do
    s.recv(data()). Will that make the socket receive all of the data in that definition?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    34
    Everything that comes into your socket over the network goes into a behind-the-scenes buffer. socket.recv() takes all the data that's currently in the buffer and returns it as a string. If you pass it a number as a parameter then it will take up-to-that-many bytes from the buffer.

    That's all it does.

IMN logo majestic logo threadwatch logo seochat tools logo