Jump to content

Need Help with Curl for TCP connection


NVergunst

Recommended Posts

Hello everyone,

 

Basically I have a program on a computer that I need to pass information back and forth to a webpage using a TCP socket.

 

I host with GoDaddy (yeah yeah let the flames begin!  ;D) and in their infinite wisdom dont allow socket_open() and fsocketopen() can only be used locally aparently. So I need to use curl as directed by them. Problem is I have never used curl. I have never even done TCP work before this past week. I have the program working, and by making a desktop application and giving it to someone else, they can connect and we can send messages back and forth. So good news is my TCP server in the program works. Now I need to make the PHP/Curl TCP client.

 

I have been looking at a few examples, and I am confused as to what it even is really. Is it like fsocketopen where it returns a handle to a stream that you can read/write to?

 

<?php

$curl_handle=curl_init();

//Magic TCP Stuff???

curl_close($curl_handle);

?>

 

Any help would be appreciated.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/113193-need-help-with-curl-for-tcp-connection/
Share on other sites

  • 2 weeks later...

Ok, well after a bit more reading and such, I think I need to use the telnet part of curl.

 

Still need help if anyone can give some advice here.

 

I havent really found a way of doing this yet. But a PHP and javascript solutions seems to be the way to go.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.