C# app receives message on socket (CSSocketServer)

The VC# code sample demonstrates creating a socket object to listen to the incoming connections. CSSocketClient and CSSocketServer show the basic socket programming.

C# (52.4 KB)
3.7 Star
12,189 times
Add to favorites
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question

  • Message size bigger than 1024 bytes
    1 Posts | Last post May 24, 2011
    • Mark, could you please post your solution how to handle large responses?
  • Client receive from server
    5 Posts | Last post May 23, 2011
    • In this example, it seems the client is actually reading the reply from the server.  It is just displaying the message that was sent to the server.  With both being "Hello World!" it is not obvious until you run it.  It would be good so show the cleint recieving a different message from the server so the round trip is complete...client send message to server...server replies with different message...client displays the message from the server.
    • That should read: The client ISN'T actually reading the reply from the server.
    • It is possible I am using a longer string in my response back to the client and that is failing to be available.  Not sure.
    • Missed this in the Description...my bad:
      There are some limitations on this sample:
      1. Due to the socket buffer size, the string message including EOM marker shouldn't
      bigger than 1024 bytes when encoded to bytes by Unicode.
      Is there an example for cases where the responses are greater than 1024?
    • Found it...Do While and read the bytestream until EOF.  Thanks for the start...