C# client with a C++ server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • turkel
    New Member
    • Mar 2008
    • 1

    C# client with a C++ server

    Hello,

    I'm trying to make connection between a C# client to a C++ server.
    Since I'm new at C/S I just downloaded sample programs, and tested them.
    I downloaded the C++ server (and client) from:
    http://www.codeproject .com/KB/IP/client_server_s ocket.aspx
    The communication succeeded.
    I also downloaded C# C/S from:
    http://www.codeproject .com/KB/IP/tcpclientserver .aspx
    It also worked.
    But when I tried to make a connection from the C# client to the C++ server it didn't work (later on I also tried other versions of servers and clients in both languages – none worked).
    What I see is that the client succeeded to connect to the server, but it didn’t succeed to send anything to the server, and the server stayed blocked waiting for the client's message (I encountered a version in which the server did get a message, i.e. was released from the blocking condition, but the message was empty).
    BTW, when I changed the code such that only the server sends a message to the client - everything worked.
    I don't know what problem to look for, nor if there is any known problems in this scenario.
    I will really appreciate any help or idea what to do.

    Thanks,
    Itzik
  • Pittaman
    New Member
    • Aug 2007
    • 20

    #2
    It shouldn't matter if the server is in C++ and the client is in C#, normally.

    But maybe the C++ server is waiting for an EOF of a newline character not provided by the C# client? I think this is more a matter of what you're sending trough and what the server expects. Ofcourse, to know what is wrong, more information about both client and server would be required.

    But it should have little to do with the actual programming language, as I'm asuming the communication is done via TCP/IP and a certain application specific protocol. The TCP/IP communications should be independent of a programming language... so it'll be mostly WHAT you're sending trough.

    Comment

    Working...