Solved

General Sockets issue

Posted on 2004-04-02
3
246 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
withoutTen challenge 14 88
scoresIncreasing challenge 10 57
VBA color chart bars 12 65
find a node in VST 2 46
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.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now