File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Simple client / server not success Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Simple client / server not success" Watch "Simple client / server not success" New topic
Author

Simple client / server not success

adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
Hi,
I have a echo server and echo client. whenever i send a line to server, it is seen at the server. But i want to send the line through the server and should receive at client. How can i do so. Some body please help. Here's the code.

EchoServer



EchoClient



Please tell me what are the changes required.
Thanks and Regards
adeeb.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8833
    
    7

The code as you posted works fine for me:



By the way, using code that depends on end-of-line markers (BufferedReader, Scanner) is not recommended when programming sockets as EOL is OS-dependent.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple client / server not success
 
Similar Threads
Server & Client are both waiting
Echo Server
Socket problem
Send a String to Server and server send it somewhere on network
FTP Socket Programming