A Simple Client Example in C for Unix
I searched and cannot find one...all I need is a simple client that can connect to the server, send a buffer, then wait for a reply.
In needs to be pure C and be Unix sockets, not winsock.
Thanks
Sure you can. Use Google or try looking through the networking resources here:
http://www.gamedev.net/reference/
http://www.gamedev.net/reference/
---------------------http://www.stodge.net
okay okay...More specific then
I am trying to call a php script from a unix proggie...
I think the following should work...
clientaddr.sin_addr.s_addr = inet_addr("http://php.foo.com/script.php?var1=hi&var2=bye");
Will that call the script, if not...What can I do to call the script from unix?
I am trying to call a php script from a unix proggie...
I think the following should work...
clientaddr.sin_addr.s_addr = inet_addr("http://php.foo.com/script.php?var1=hi&var2=bye");
Will that call the script, if not...What can I do to call the script from unix?
No that''s not how it''s done. I''m no expert, but you need to connect to the HTTP server, and then request the page. For example, connect to address "php.foo.com" port 80 (I think), and then send something like "GET script.php?var1=hi&var2=bye".
Of course, I''ve no idea what I''m talking about, so you need to learn how a web server works, and you need to learn the HTTP protocol, which is after all, what you''re trying to deal with here.
Of course, I''ve no idea what I''m talking about, so you need to learn how a web server works, and you need to learn the HTTP protocol, which is after all, what you''re trying to deal with here.
---------------------http://www.stodge.net
right...thanks a lot you helped me out a good deal
but you can connect to a server using:
clientaddr.sin_addr.s_addr = inet_addr("http://php.foo.com/");
Instead of something like:
clientaddr.sin_addr.s_addr = inet_addr("129.45.29.8");
Right, both of those would connect fine?
but you can connect to a server using:
clientaddr.sin_addr.s_addr = inet_addr("http://php.foo.com/");
Instead of something like:
clientaddr.sin_addr.s_addr = inet_addr("129.45.29.8");
Right, both of those would connect fine?
As far as I know you can''t connect to "http://php.foo.com/", but you can connect to "php.foo.com" with what you''re trying to do. If you want to connect to php.foo.com, you need to resolve the domain name into an IP address. Or you could connect to "129.45.29.8", but this isn''t so flexible or as easy to read.
This site should help:
http://www.ecst.csuchico.edu/~beej/guide/net/html/index.html
This site should help:
http://www.ecst.csuchico.edu/~beej/guide/net/html/index.html
---------------------http://www.stodge.net
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement