Real Software Forums

ServerSocket example, how does it work!?
Page 1 of 1

Author:  Eclipse [ Fri Mar 15, 2013 6:47 pm ]
Post subject:  ServerSocket example, how does it work!?

First, there is a ServerSocket.

Then a ClientSocket taken from the TCPSocket.
But after the line "CurSocket is an Integer property of the window and is initialized to 0." there is a ClientSocket again!?

Or, is that a third TCPSocket? I don't quite follow... and staring at hours at this example doesn't make me any brighter!!
What am I missing!?

Author:  timhare [ Fri Mar 15, 2013 7:03 pm ]
Post subject:  Re: ServerSocket example, how does it work!?

That page is describing 2 separate programs. The first one is the server and has a serversocket and a clientsocket and is described down to the line:

"This triggers the AddSocket event that creates the initial pool of sockets."

It listens for incoming connections.

The second program is the client program and makes connections to the server program. Its description begins at the line

"The client application has a "Connect" button to connect to the ServerSocket application"

It has an array of tcp sockets, which the line you're talking about refers to. The whole thing is further complicated by the fact that both programs use a variable named cursocket.


Author:  Eclipse [ Sat Mar 16, 2013 3:40 am ]
Post subject:  Re: ServerSocket example, how does it work!?

Make sense! Thank you!
I think this code is far from complete because I get many errors while compiling both the server and the client.

But I also read elsewhere in this forum, others also find this example difficult.
But in one way or another, it must be working and I just need more experience!!
I found a working example of a really neat code but I don't know where it origins from...

Maybe I shall just fiddle with that code and edit it to suit my needs!?
For now, it might be as bright...??? Haha!!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group