Are there any examples out there for socket programing? I need to write a test app that connects to s specified IP and port to send and receive ASCII strings. I am not sure which libraries to use or the API. Thanks. Chris Taylor
On 11/9/05, cjtaylor_mail-suse@yahoo.com
Are there any examples out there for socket programing? I need to write a test app that connects to s specified IP and port to send and receive ASCII strings. I am not sure which libraries to use or the API. Thanks.
I've attached two examples, that exchange ASCII data. Hope they give you an idea how things work. They should compile and work as expected (haven't touched them for years until now). The files errors.c and header.h are needed for error handling among other things and are included for completeness. If you have questions, feel free to drop me a line. \Steve
--- Steve Graegert
I've attached two examples, that exchange ASCII data. Hope they give you an idea how things work. They should compile and work as expected (haven't touched them for years until now). The files errors.c and header.h are needed for error handling among other things and are included for completeness. If you have questions, feel free to drop me a line.
\Steve
Thanks Steve. That should help a lot. Chris
On Wednesday 09 November 2005 11:39 am, cjtaylor_mail-suse@yahoo.com wrote:
Are there any examples out there for socket programing? I need to write a test app that connects to s specified IP and port to send and receive ASCII strings. I am not sure which libraries to use or the API. I have some code laying around. I'll send it to you directly.
--
Jerry Feldman
On Wed, 9 Nov 2005 cjtaylor_mail-suse@yahoo.com wrote:
Are there any examples out there for socket programing? I need to write a test app that connects to s specified IP and port to send and receive ASCII strings. I am not sure which libraries to use or the API. Thanks.
If you REALLY want to know how to do it and why, I recommend very highly the Stevens book "Unix Network Programming", Volume 1. I have that and Volume 2, plus his "Advanced Programming in the UNIX Environment". I refer to them a lot. -- Curt, WE7U. APRS Client Comparisons: http://www.eskimo.com/~archer "Lotto: A tax on people who are bad at math." -- unknown "Windows: Microsoft's tax on computer illiterates." -- WE7U "The world DOES revolve around me: I picked the coordinate system!"
Same here. Best books I own. Curt, WE7U wrote:
If you REALLY want to know how to do it and why, I recommend very highly the Stevens book "Unix Network Programming", Volume 1. I have that and Volume 2, plus his "Advanced Programming in the UNIX Environment". I refer to them a lot.
-- Curt, WE7U. APRS Client Comparisons: http://www.eskimo.com/~archer "Lotto: A tax on people who are bad at math." -- unknown "Windows: Microsoft's tax on computer illiterates." -- WE7U "The world DOES revolve around me: I picked the coordinate system!"
On Wednesday 09 November 2005 12:02 pm, Curt, WE7U wrote:
If you REALLY want to know how to do it and why, I recommend very highly the Stevens book "Unix Network Programming", Volume 1. I have that and Volume 2, plus his "Advanced Programming in the UNIX Environment". I refer to them a lot. Those are excellent books. While I never owned them, I always had them available at work. They are the bible of socket programming and H. Richard Stevens' death in 1999 was a real blow to the industry. -- Jerry Feldman
Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
On Wednesday 09 November 2005 11:39, cjtaylor_mail-suse@yahoo.com wrote:
Are there any examples out there for socket programing? I need to write a test app that connects to s specified IP and port to send and receive ASCII strings. I am not sure which libraries to use or the API. Thanks.
This guy has a nice tutorial that explains it from the ground up: http://beej.us/guide/bgnet/
On Wednesday 09 November 2005 17:39, cjtaylor_mail-suse@yahoo.com wrote:
Are there any examples out there for socket programing? I need to write a test app that connects to s specified IP and port to send and receive ASCII strings. I am not sure which libraries to use or the API. Thanks.
If you're learning programming, go for it. But if you really just need to test something, there is netcat, which already does everything you need
participants (7)
-
Anders Johansson
-
cjtaylor_mail-suse@yahoo.com
-
Curt, WE7U
-
Jerry Feldman
-
Joe Georger
-
Steve Graegert
-
Synthetic Cartoonz