Jump to content

REQUEST and RESPONSE json via TCP/IP connection.

Recommended Posts


I want send a REQUEST  and RESPONSE via TCP/IP connections. Here my code but it not work. please help me. Thank for all.


Global $MainSocket
Local $MaxLength = 1512; Maximum Length Of Text
Local $Port = 3333; Port Number
Local $Server = ''; Server IpAddress
$MainSocket = TCPConnect($Server, $Port)
If $MainSocket = -1 Then Exit MsgBox(16, "Error", "Unable to connect.")
 Local $Data1 ='{"id":0,"jsonrpc":"2.0","method":"miner_getstat1"}'

   TCPSend($MainSocket, "miner_restart")
    $Data = TCPRecv($MainSocket, $MaxLength)

        MsgBox(0, "Received Packet", $Data)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.