Perl socket on linux won't accept connections from windows clients

E

Eli Sidwell

I am trying to write a tcp server for linux using perl.

When I run the file it works, but it only accepts connects form linux,
won't accept connects from windows apps.

Any help is appreciated.

Sid.
 
P

penguinista

Eli said:
I am trying to write a tcp server for linux using perl.

When I run the file it works, but it only accepts connects form linux,
won't accept connects from windows apps.

Any help is appreciated.

Sid.
is accept() not accepting a connect or is the server having trouble
after that? What kind of client are you using?

- microsoft has had cases of not playing exactly according to
established protocols.

- windows uses a <cr><lf> end of line indicator whereas *nix uses just
<lf>. The difference can cause difficulty if unnaccounted for.
 
J

Jeff Dunn

I am trying to write a tcp server for linux using perl.

When I run the file it works, but it only accepts connects form linux,
won't accept connects from windows apps.

Any help is appreciated.

Sid.

Well there shouldnt be any difference, you might try posting your code
 
E

Eli Sidwell

penguinista said:
is accept() not accepting a connect or is the server having trouble
after that? What kind of client are you using?

- microsoft has had cases of not playing exactly according to
established protocols.

- windows uses a <cr><lf> end of line indicator whereas *nix uses just
<lf>. The difference can cause difficulty if unnaccounted for.

It appears that the client never gets an accept. Perl code does not
seem to hang or error. Clients: MS Telnet and Winsock via. VB.
I can telnet to the server from Linux(same box) and it works as
expected.
 
J

Joe Smith

Eli said:
I am trying to write a tcp server for linux using perl.

When I run the file it works, but it only accepts connects form linux,
won't accept connects from windows apps.

I've written TCP servers that work just fine accepting incoming connections
from Linux, Solaris and Windows. There is nothing in the TCP protocol
that discriminates against one OS versus another.
-Joe
 
E

Eli Sidwell

Joe Smith said:
I've written TCP servers that work just fine accepting incoming connections
from Linux, Solaris and Windows. There is nothing in the TCP protocol
that discriminates against one OS versus another.
-Joe

I have solved the problem with not accepting connections from MS
Telnet, but I am still having a problem with sending data via. a VB
application. The client connects and the server acknowledges it, but
the Perl Script never gets any data. like it did from MS Telnet.

Thanks

Sid ..
 
E

Eli Sidwell

I have solved the problem with not accepting connections from MS
Telnet, but I am still having a problem with sending data via. a VB
application. The client connects and the server acknowledges it, but
the Perl Script never gets any data. like it did from MS Telnet.

Thanks

Sid ..

I have solved the issue with the MS VB Winsock.
Issue: Winsock won't flush
Solution: Append the text with Chr(0) or
Chr(13) & Chr(10) & "." & Chr(13) & Chr(10) (who knows why this works) or
Precede the text with the length of the text (again, who knows) or
make the text bigger than 2k.

New Issue: If the Winsock misbehaves and closes the connection incorrectly
Perl prints out "Broken Pipe" and exits the script.
Is there anyway to trap this error and just set the port to listen again ?

Thanks

Sid.
 
G

Gavin Williams

The last comment reminds me of an issue I encountered that was
similar....you mentioned you can connect from the "same box".

The issue them might not be Win32 vs. Linux...but the value of the "local"
address used to create the server.

My experience was with using IO::Socket::INET to create a server, and I used
the loopback address (127.0.0.1) for the "LocalAddr" option when I created
my server object.

I could connect all day from the same system but never from any other
systems on the network. When I changed the value of "LocalAddr" to the host
system's LAN address, everything could connect as expected.

Depending on what you used to construct the server, if the server's local
address is "127.0.0.1" then it may only accept connections from clients
requesting address 127.0.0.1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top