Solved

General Sockets issue

Posted on 2004-04-02
3
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn different types of Android Layout and some basics of an Android App.
Introduction to Processes
Starting up a Project

622 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