G
Guest
Hello:
I have an strange problem. i am new in sockets, and i'm developing a
client-server application. My client sends information to the server, and it
works. The server receives the information and sends an ACK to the client,
and it works too.
But the problem is that if the client "arrives" to the receive call before
the server sends the ACK, the client doesn't block, go on and receive
nothing...
The more strange thing is that it works in the server. It waits for the
information from the client, and if the information from the client arrives
later than the server arrives to the Receive call, the server waits.
i have the same call in both, this is the code:
---SERVER---
byte [] buf = new byte[1024];
while(true) {
try {
bytesLeidos = nuevoSocket.Receive(buf);
}
}
---CLIENT---
int longitud = socket.Available;
bufferLectura = new byte[longitud];
int resultado = socket.Receive(bufferLectura);
When i create the socket, in the server and in the client i define the
property Blocking of the Socket to TRUE.
Please help me, i am near to finish this application and can't do it until
it stupid thing works.
Thanks for the help.
Bye.
I have an strange problem. i am new in sockets, and i'm developing a
client-server application. My client sends information to the server, and it
works. The server receives the information and sends an ACK to the client,
and it works too.
But the problem is that if the client "arrives" to the receive call before
the server sends the ACK, the client doesn't block, go on and receive
nothing...
The more strange thing is that it works in the server. It waits for the
information from the client, and if the information from the client arrives
later than the server arrives to the Receive call, the server waits.
i have the same call in both, this is the code:
---SERVER---
byte [] buf = new byte[1024];
while(true) {
try {
bytesLeidos = nuevoSocket.Receive(buf);
}
}
---CLIENT---
int longitud = socket.Available;
bufferLectura = new byte[longitud];
int resultado = socket.Receive(bufferLectura);
When i create the socket, in the server and in the client i define the
property Blocking of the Socket to TRUE.
Please help me, i am near to finish this application and can't do it until
it stupid thing works.
Thanks for the help.
Bye.