Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 8th, 2005, 7:14 AM   #1
beichu
Newbie
 
Join Date: Aug 2005
Posts: 1
Rep Power: 0 beichu is on a distinguished road
Send a message via MSN to beichu
Python, GUI and sockets.

Hello,
I need help, with making a socket server in Python.
I have already searched google and stuff, but haven't found anything useful.
I do have found some echo server examples, but they terminate themselves, as soon, as the client leaves. Also I have found examples, what support multiple clients, but they don't work (they give me errors, when I run them).
Alse, I want to make this server with graphical user interface (gui), but I haven't understood, how to program GUI in Python.

In general i want to make asynchronous socket server with gui, rooms and stuff, running on TCP and every message terminated by zero byte ( \0 ).
Please someone help me : )
beichu is offline   Reply With Quote
Old Aug 8th, 2005, 8:59 AM   #2
Riddle
Programmer
 
Riddle's Avatar
 
Join Date: May 2005
Location: Nar Shaddaa
Posts: 42
Rep Power: 0 Riddle is on a distinguished road
Send a message via ICQ to Riddle Send a message via AIM to Riddle Send a message via MSN to Riddle
You like that comma key? Anyway.. check out the . Check

I'm not quite sure what you mean- the program ends whenever it has no clients connected? That doesn't make a lot of sense. Check this, as well as google results for things like "python socket example." Here are a few links from the Python docs:

http://docs.python.org/lib/module-SocketServer.html
http://docs.python.org/lib/module-socket.html


I'm not good with gui-related things (not in Python, C++, or anything that I try), so I can't give a whole lot of help on Tkinter. But I can provide a few links:

http://docs.python.org/lib/tkinter.html
http://docs.python.org/lib/module-Tkinter.html
Riddle is offline   Reply With Quote
Old Aug 8th, 2005, 2:50 PM   #3
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Quote:
I need help, with making a socket server in Python.
I have already searched google and stuff, but haven't found anything useful.
Depends what you define as useful. Really, I found the socket module server and client examples more than enough to get anyone started.
Quote:
I do have found some echo server examples, but they terminate themselves, as soon, as the client leaves.
Well, take a guess at why that might be. Look at the server example, and you'll see it's only set up to handle one connection, and then it exits. You should put it in an infinite loop so that is constantly accepting a new connection.
Quote:
Also I have found examples, what support multiple clients, but they don't work (they give me errors, when I run them).
Oh yeah? Care to provide a link to the respective samples and provide the errors?
Quote:
Alse, I want to make this server with graphical user interface (gui), but I haven't understood, how to program GUI in Python.
Eh? That's a bit of a peculiar one, server-side applications (mostly daemons) usually run un-attended in the background. Nonetheless, you might be doing something altogether different. For creating GUIs with Python I recommend wxPython and PyQt. I would not recommend Tkinter.

Quote:
In general i want to make asynchronous socket server with gui, rooms and stuff.... and every message terminated by zero byte ( \0 ).
Whoa, hold your horses there. Judging by the fact that you couldn't figure out how to make the server socket example not exit after the first connection, I don't think you're up for creating a huge asynchronous network application with a GUI.
As for rooms and stuff.... what do you mean? Rooms as in rooms in a game? If you're making a game server, you definitely don't want it to have a GUI. Needs to be as efficient and low overhead as possible.

If you're making anything remotely "big" - e.g an asynchronous (not multi-threaded) server application, I strongly recommend the Twisted network framework. It's a robust, scalable framework, with a more object orientated API than the C-style socket module.
Cerulean is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:35 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC