CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    154

    [RESOLVED] send() linux to windows?

    Hi,

    I've written a network program based on berkeley socket standard.

    Everything works when it comes to accepting connection, connecting, sending data and receiveing data.

    However, if I run a Windows server, and a Linux client. and the Linux client connects to the server, and then starts sending data through send() function, then the data is not received at the Windows Server?? I'm using recv() to catch it.

    The Linux Client can receive data from the Windows Server... but not send...

    Also Linux Server with Linux Client works normally... Same with Windows on Windows.

    This is very strange, do I need to set some setsockopt() or something on Linux? Am I missing something standard?

    Is it possible that Linux manipulates the data of the packet? Because the first 2 bytes of the data is the length of the packet, and so my receiver could deny an incorrect formatted data (and so it looks like there was no data sent), I haven't checked yet if the data is actually transmitted or not at the Windows Server through Wireshark or something. But hoping to see if someone knows more.

    By the way its Linux-based Ubuntu what I'm testing on.

    Thanks,

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: send() linux to windows?

    Could it be a Byte Ordering problem?
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2009
    Posts
    154

    Re: send() linux to windows?

    Thanks for your response

    I checked it but both machines are Little Endian

  4. #4
    Join Date
    Jul 2009
    Posts
    154

    Re: send() linux to windows?

    Solved it... I checked with packet analyzer and noticed that Linux sizeof(wchar_t) == 4.. and in windows sizeof(wchar_t) == 2...

    Great...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured