Solved

General Sockets issue

Posted on 2004-04-02
3
273 Views
Last Modified: 2012-05-04
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
Comment
Question by:adam_chu
3 Comments
 
LVL 12

Expert Comment

by:dfiala13
ID: 10745526
Post your code and possibly move this to the .NET section.  You might have better luck.
0
 
LVL 8

Accepted Solution

by:
RLGSC earned 500 total points
ID: 10747127
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
 

Author Comment

by:adam_chu
ID: 10758014
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question