Thread: Saving Sockets

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    A:\
    Posts
    17
    Rep Power
    0

    Question Saving Sockets


    I was wondering wether or not you can save a socket class instance to a file. Pickle and marshal don't work, so i was hoping there is an alternative to these to that can save all classes possible. I need to know this because unless my threading gui for the chat program i'm working on works, I need two seperate programs to work on the same socket at once. Thanks in advance.
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69

    Why?


    I'm a little unclear about what you mean, not having done much with socket. If you want to store a class why not just write a module and then import it? I know Pickle/Cpickle allow you to do it but i never really understood why you would want to?

    Any expliation would be good, thanks.

    have fun,
    Mark.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    A:\
    Posts
    17
    Rep Power
    0
    Well, i wanted to save an open socket to a file so that two programs can use the same socket. It's sopposed to be an easier alternative to threading, just having two seperate programs. But i would need to save the open socket. Anyway, i figured out how to fix my threading problem, so i just have to work out a few bugs and i'll have a simple chat client/server.
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    How did you solve the problem agrif? would be interesting to see what you ment and how you overcame the problem.

    Thanks,
    Mark.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    A:\
    Posts
    17
    Rep Power
    0
    well, i don't really know. I just switched what the threads did. I had the main thread do the receiving and the new thread handle Tkinter and sending. I guess that new threads can't handle infinite loops.

IMN logo majestic logo threadwatch logo seochat tools logo