Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

server socket that can handle input and output

Hi,

I am trying below example
http://www.avajava.com/tutorials/lessons/how-do-i-write-a-server-socket-that-can-handle-input-and-output.html

after i ran example and opened command prompt.
I gave command >>telnet localhost 81

i am getting error


C:\>telnet locahost 81
'telnet' is not recognized as an internal or external command,
operable program or batch file.


How to fix this.
what is the purpose of this example.

please advise
Any links resources ideas highly appreciated. Thanks in advance
Avatar of krakatoa
krakatoa
Flag of United Kingdom of Great Britain and Northern Ireland image

Maybe I am not clear about your question, but a ServerSocket just sets up a Socket as an end-to-end connection with another host's socket, by implementing its .accept() method.
Avatar of gudii9

ASKER

opened command prompt.
I gave command >>telnet localhost 81

i am getting error


C:\>telnet locahost 81
'telnet' is not recognized as an internal or external command,
operable program or batch file.



what it means by telnet not recognized. please advise.

ServerSocket just sets up a Socket as an end-to-end connection with another host's socket, by implementing its .accept() method.

why we need sockets and end to end connection. i never remember using them in real time projects myself. Please advise
ASKER CERTIFIED SOLUTION
Avatar of krakatoa
krakatoa
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is an error message from your Operating System saying that you don't have the telnet program installed.

There is a chance, also, that it is not that, but that you have a messed up reference to telnet in your environment variables, and so the OS can't find it. You might want to check that.

It would be pretty unusual that your OS hadn't bundled telnet.

(If you run Windows, you can search your hard disk like this :) dir C:\telnet.* /s
Avatar of gudii9

ASKER

i checked it is windows 7 enterprise operating system.
i checked it is windows 7 enterprise operating system.

Yes, but did you run that little command I posted above, to see if telnet is resident?
@krakatoa,
It would be pretty unusual that your OS hadn't bundled telnet.
If you have a look at the link that I posted above, the very first (informative) line on the page states:
Telnet Client is not installed by default on Windows 7, Windows Server 2008 R2, Windows Vista, or Windows Server 2008.
And note that I didn't say that it ISN'T included (bundled) with Windows, it's just that it isn't installed by default.

@gudii9,

Did you attempt to install Telnet using the instructions provided in the link above?
If you have a look at the link that I posted above, the very first (informative) line on the page states:

I don't always have time to read links.

I'll remember not to "overinform" people next time.
Avatar of gudii9

ASKER

when i tried above command

C:\Users\xyz001>C:\telnet.* /s
The system cannot find the path specified.

I got above message. I will try to install by following above link once I reach home from home laptop.
No!

dir C:\telnet.* /s
Avatar of gudii9

ASKER

i see like

Volume in drive C is OSDisk
Volume Serial Number is AAAA-BBBB

please advise
OK, so when it finishes the search, if it says :

"File not Found"

then you do not have telnet installed.
Avatar of gudii9

ASKER

will try from home laptop later and let you know
Avatar of gudii9

ASKER

i tried from home laptop it did not work here as well.


I gave the command and looks like telnet is there


02/04/2014  10:19 AM            10,576 telnet.h
               1 File(s)         10,576 bytes

 Directory of C:\Windows\SoftwareDistribution\Download\bcfed137e95e2bc1b83ef8026
2a82b16\x86_microsoft-windows-telnet-client_31bf3856ad364e35_6.0.6002.18005_none
_ba1d0a71222c35d2

04/11/2009  01:28 AM            70,656 telnet.exe
               1 File(s)         70,656 bytes

 Directory of C:\Windows\winsxs\x86_microsoft-windows-t..et-client.resources_31b
f3856ad364e35_6.0.6000.16386_en-us_7ac6e3ffd37e7001

11/02/2006  07:41 AM            14,848 telnet.exe.mui
               1 File(s)         14,848 bytes

 Directory of C:\Windows\winsxs\x86_microsoft-windows-telnet-client_31bf3856ad36
4e35_6.0.6001.18000_none_b8319165250a6a86

01/20/2008  09:25 PM           206,336 telnet.exe
               1 File(s)        206,336 bytes

     Total Files Listed:
               5 File(s)        302,511 bytes
               0 Dir(s)  82,173,440,000 bytes free

C:\Users\ganesha>

Not sure when i say
telnet localhost 81

Server did not ask our name as given in link

The server asks us our name, so I typed 'Bob'. It says 'Hello, Bob' and then closes the connection.
Avatar of gudii9

ASKER

My eclipse console showed when i ran program as below though
Creating server socket on port 81