Solved

General Sockets issue

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
A short article about problems I had with the new location API and permissions in Marshmallow
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

920 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

15 Experts available now in Live!

Get 1:1 Help Now