LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-01-2002, 09:41 PM   #1
ChimpFace9000
Member
 
Registered: Jul 2001
Location: So. Cal.
Distribution: Slackware 8.1
Posts: 55

Rep: Reputation: 15
Post Testing a socket app


I wrote an app that uses sockets. It recv's strings, and depending on the string, it performs an action. Ill eventually write a client to send the strings, but id like to test it right now. I thought i could do this with telnet, but couldnt figure it out. Is there some program that will let me connect to my server and send strings? Or will telnet do this?
 
Old 05-02-2002, 07:23 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Yes telnet will work fine for that:
telnet hostname portnumber

The hostname can usually be localhost, and the portnumber is the number you told your server to listen on.

Just another thing. The above is only true if you are using stream sockets (TCP/IP) in your application. If you are using datagram (UDP/IP) or other type of sockets then it won't work with telnet.

Last edited by Mik; 05-02-2002 at 07:25 AM.
 
Old 05-02-2002, 10:58 AM   #3
ChimpFace9000
Member
 
Registered: Jul 2001
Location: So. Cal.
Distribution: Slackware 8.1
Posts: 55

Original Poster
Rep: Reputation: 15
Well i knew that. I just couldnt figure out how to send a string. I thought something like "send "hello"", but i just get errors.
 
Old 05-02-2002, 03:03 PM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Well if you are getting errors then there must be something wrong with your program then. Once you are connected with telnet everything you type will get sent directly to the server side.
Don't need to type any specific commands.

What kind of errors are you getting though?
 
Old 05-02-2002, 03:07 PM   #5
ChimpFace9000
Member
 
Registered: Jul 2001
Location: So. Cal.
Distribution: Slackware 8.1
Posts: 55

Original Poster
Rep: Reputation: 15
When i connect, it lets me type stuff, but all it doesnt do anything.
 
Old 05-02-2002, 03:39 PM   #6
lucianomx
LQ Newbie
 
Registered: May 2002
Location: Brazil
Distribution: Conectiva
Posts: 7

Rep: Reputation: 0
Well, telnet is perfect for this situation, mainly if your server app receive strings, because telnet faithfully sends each byte you type to server and show each byte received from server on screen.

Rather than, if your app expect a especific format of commands, telnet maybe no work properly, because you will have dificulty to type binary data.

Luciano
(Brazil - Sao Paulo/SP )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot read data at server socket, though client socket sends it jacques83 Linux - Networking 0 11-15-2005 01:58 PM
Single Socket Vs Multiple Socket Kumar Programming 1 10-05-2005 10:02 AM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 07:28 PM
LAN Speed testing/benchmarking app? kz26 Linux - Networking 1 08-17-2005 01:50 AM
Setup as getting debian testing files from ftp - will it stay with testing BrianHenderson Debian 2 09-02-2004 06:06 PM


All times are GMT -5. The time now is 12:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration