Board index » cppbuilder » a Client connection without Server accept() : possible ?
a Client connection without Server accept() : possible ?
2006-06-01 08:29:45 PM
As guys here seem smart, is there any explanation to this fact :
1- I launch a TCP server (socket(AF_INET, SOCK_STREAM, 0)
+ bind + listen) and break my prog immediately AFTER completion
of listen(). So, the server is stopped here and shall NEVER
accept() any connection.
NOTA : the server is programmed with VisualC++2005 (8.0)
2- I launch a TCP client (socket)
NOTA : the client is programmed with Borland C++ 6.0 with the
VCL Lib (ClientSocket).
3- I press a button which sets the ClientSocket->Active flag
to "true". This is the only thing I do with this VCL component
to connect a client to a server (as far as I know).
RESULT : The client tells that the connection has been
successfully established with the server. I verify this with
the flag ClientSocket->Socket->Connected = true !
The weird thing is that the server is breaked : which mechanism
has accepted the client socket connection ? Not the server !
I cannot find any explanation. It changes my view of the listen
function : it does not work as I believe... I thought that only
the accept() function validates the client connection request...
Any idea of test(s) to understand this behavior ?