socket problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

socket problem

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

can you explain in more detail which part is connecting to what and when/how?
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

more details

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

is the protocol line based? if so maybe you have to experiment with the CR/LF-characters a bit.
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

thanks - problem solved

Post 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
Post Reply