Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

General Sockets issue

I have a server that responds with appropriate text when I type in: get /stream? in a telnet session connected to port 8080.  My problem is when I write a client (.net) I can connect and write to the server but I cannot read.  My question is WHAT is the difference between typing get /stream? in the telnet session and doing a network stream write of get /stream? ?

Anything / something ...please,
0
adam_chu
Asked:
adam_chu
1 Solution
 
dfiala13Commented:
Post your code and possibly move this to the .NET section.  You might have better luck.
0
 
RLGSCCommented:
Adam_Chu,

Without the code (and the time to look at the code) this is speculation, however,

I would carefully check to see if the "network stream write" includes a line terminator (probably LF in a TCP/IP stream, or possibly CR). The telnet write almost certainly includes the line termination sequence.

Remember that TCP is stream-oriented, thus there is no inherant record break at the end of the string written to the stream. The five call sequence:

  writetosocket("This ");  writetosocket("is ");  writetosocket("a ");  writetosocket("test ");  writetosocket("message\n");

is equivalent (in terms of useful data written to the connection--albeit less efficient) than:

  writetosocket("This is a test message\n");

I suspect that your read call may be working, just that your network application has not seen the end of the line yet (so it hasn't written any data for you to read).

I hope that the above is helpful.

- Bob (aka RLGSC)
0
 
adam_chuAuthor Commented:
It seems httpwebrequest solves my issues....Does this class use the socket class at it's foundation or am I missing something?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now