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

Discussion in 'Perl' started by Eli Sidwell, Jun 11, 2004.

  1. Eli Sidwell

    Eli Sidwell Guest

    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.
    Eli Sidwell, Jun 11, 2004
    #1
    1. Advertising

  2. Eli Sidwell

    penguinista Guest

    Eli Sidwell wrote:
    > 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.
    penguinista, Jun 11, 2004
    #2
    1. Advertising

  3. Eli Sidwell

    Jeff Dunn Guest

    (Eli Sidwell) wrote in message news:<>...
    > 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
    Jeff Dunn, Jun 12, 2004
    #3
  4. Eli Sidwell

    Eli Sidwell Guest

    penguinista <> wrote in message news:<40ca3650$0$21965$>...
    > Eli Sidwell wrote:
    > > 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.


    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.
    Eli Sidwell, Jun 12, 2004
    #4
  5. Eli Sidwell

    Joe Smith Guest

    Eli Sidwell wrote:

    > 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
    Joe Smith, Jun 14, 2004
    #5
  6. Eli Sidwell

    Eli Sidwell Guest

    Joe Smith <> wrote in message news:<b0czc.20257$Hg2.3338@attbi_s04>...
    > Eli Sidwell wrote:
    >
    > > 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


    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 ..
    Eli Sidwell, Jun 15, 2004
    #6
  7. Eli Sidwell

    Eli Sidwell Guest

    (Eli Sidwell) wrote in message news:<>...
    > Joe Smith <> wrote in message news:<b0czc.20257$Hg2.3338@attbi_s04>...
    > > Eli Sidwell wrote:
    > >
    > > > 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

    >
    > 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.
    Eli Sidwell, Jun 18, 2004
    #7
  8. 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.

    "Eli Sidwell" <> wrote in message
    news:...
    > penguinista <> wrote in message

    news:<40ca3650$0$21965$>...
    > > Eli Sidwell wrote:
    > > > 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.

    >
    > 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.
    Gavin Williams, Jun 24, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Francesco
    Replies:
    1
    Views:
    519
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Dec 27, 2006
  2. billiejoex
    Replies:
    4
    Views:
    552
    billiejoex
    Mar 21, 2007
  3. John Nagle
    Replies:
    12
    Views:
    1,578
    Dennis Lee Bieber
    Jan 16, 2008
  4. Lee Skillen
    Replies:
    1
    Views:
    185
  5. Eli Sidwell
    Replies:
    1
    Views:
    121
    John Bokma
    Jun 10, 2004
Loading...

Share This Page