Page 1 of 1

socket problem

Posted: Mon Mar 10, 2003 4:37 am
by Guy
I'm connecting from windows pc to a service which runs on Linux.
I'm using fsocketopen, fputs and fgets.
after sending my string to the server, I got stuck, and the port of the server
becomes unavailable for a few minutes ( meaning I'm killing the service)
anyone knows how to release the port after few seconds,
and if there are any known problems when connecting from windows (through ie)
to a Linux server ?
thanks
Guy

Posted: Mon Mar 10, 2003 6:03 am
by volka
can you explain in more detail which part is connecting to what and when/how?

more details

Posted: Mon Mar 10, 2003 7:54 am
by Guy
after more investigation and debugging, I think that the problem is
that I get stuck with the buffer.
meaninig: only when I close my socket the service receives my string, but then I'm not there to get his answer.
when he sends me info I get it and when I send him info and close my socket he gets my info.
the problem is leaving the socket alive and completing the data transfer.
I hope I was more clear.
thanks
Guy

Posted: Mon Mar 10, 2003 10:23 am
by volka
is the protocol line based? if so maybe you have to experiment with the CR/LF-characters a bit.

thanks - problem solved

Posted: Mon Mar 10, 2003 10:52 am
by Guy
I think I've solved it changing the byte order on the server( I hope it will run the same on most Linux releases)
and using fread - im sending the data using fputs.
i hope it's not a probelm.
thanks again
Guy