The same way as the client, because it will also have two sockets.Originally Posted by cmeliak
The same way as the client, because it will also have two sockets.Originally Posted by cmeliak
ok. if i understud it well, i should create 2 sockets on the client and two sockets on the server. so, but how to force client to connect to certain socket? actualy server creates socket for each connection. i am really confused guys. do you have some picture for me?![]()
QT3winFREE....doin' just 4 fun
You can't. Client connects to a given port and it even doesn't know what program listens there.Originally Posted by cmeliak
You could use different ports (like FTP does), but IMO it isn't necessary. Just add another command to your protocol that will allow clients to choose connection type. For example "CHAT MODE" would switch the connection into chat connection, while "CONTROL MODE" --- into connection that controls the session.
You will also need some kind of authentication mechanism, so that can tell which connection belongs to which client (note that user might start multiple instances of a client program on his computer).
But do you really need two connections?
Or provide control sequences made of unused characters (and escape them during normal transmission) so that you don't have to handle different "modes".Originally Posted by jacek
To be honest this should be simply realised as urgent data (TCP) but I doubt Qt allows one to send/receive them.
Edit: Another way could be to provide "commands" between the client and the server and treat chat transmission as another command in network traffic.
Last edited by wysota; 8th June 2006 at 00:20.
Bookmarks