Fabian,
are you actually using a ServerSocket, or did you just use the .Listen
method of the EasyTCPSocket?
To allow multiple simultaneous (incoming) connections, you need to use
an actual ServerSocket. I have never worked with EasyTCPSocket, so I
can't confirm that thay work with the ServerSocket, but I'm pretty
confident that they will. The rules just say that just one socket can
_listen_ (for new connections) on a particular port on one machine,
but since that is done by the server socket, there is no need to
change the port for subsequent connections. That would be a disaster
for every web server on the 'net :)
Do you get an error code on the second client socket? What does it say?
If this is Mac OS X, the terminal command "lsof|grep TCP" will give
your a good overview what's happening on your socket(s).
Cheers,
Frank+++
Am 26.02.2009 um 20:20 schrieb Fabian Rueger:
Hi everyone,
Ookay, maybe I do not understand TCP/IP after all...
I am writing a server/client application; the problem is: Only one
client seems to be able to connect, but not more.
On my server, there is a serversocket set to Port X (larger than
1024).
First client connects, logs in, all is wonderful. It connects on
that port x, and keeps talking on it too.
Second client attempts to connect... and can't even get in. It's as
if he never attempted.
The server's sockets handed out are the same subclass of
EasyTCPsockets I use to connect with the clients, they just know via
a boolean property
whether they operate from a server or client side.
Which begs the question:
Can a server have multiple sockets (his serversocket and a plethora
of EasyTCP socket subclasses) operating _all_ over the same port (x),
or do I need to change the ports on the non-server sockets once the
connection is established? (To port x+1, x+2, ...x+n?)
Any comments would surely be scrutinized for content and
appropriately appreciated.
--
Günter Schmidt GmbH
Frank Bitterlich eMail: bitterlich@gsco.de
Ben-Gurion-Ring 21 WWW: http://www.gsco.de/
D-60437 Frankfurt Tel.: 069 / 156809-29
GERMANY Fax: 069 / 156809-28
Geschäftsführer: Jürgen Hartwich
AG Frankfurt am Main, HRB 76504 - USt.-ID: DE235219624
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|