Jump to content

Packets and WSA Error 10054


Recommended Posts

I'm having trouble with the TCPSend function. I keep getting WSA Error 10054:

WSAECONNRESET

Error Number: 10054

Connection reset by peer.

A existing connection was forcibly closed by the remote host.

This normally results if the peer application on the remote

host is suddenly stopped, the host is rebooted, or the remote

host used a "hard close" .

But this entire time, the game is open and everything. I don't understand why I'm getting that error message.

Here's my code:

Dim $Startup, $Socket, $Send, $ItemPacket, $Item, $Price, $ItemIDforSend
$Startup = TCPStartup()
If $Startup = 0 Then MsgBox(0, "Error", "TCPStartup failed:" & @error)

HotKeySet("{ESC}", "Quit")

$Socket = TCPConnect("63.251.217.122", 8989)
If $Socket = -1 Then MsgBox(0, "Error", "TCPConnect failed:" & @error)
If @error = 1 Then MsgBox(0, "Error", "The IP Address is incorrect.")
If @error = 2 Then MsgBox(0, "Error", "The Port is incorrect.")

While 1
    $Send = TCPSend($Socket, 'F1 00 05 01 00 00 00 02 00 00 00 00 00 00 00 01 01 01 00 00 00 00 00')
    If $Send = 0 Then MsgBox(0, "Error", "TCPSend failed:" & @error)
    ;   $ItemPacket = TCPRecv($Socket, 2048)
    ;   $Item = BinaryMid ( $ItemPacket, 27, 3 )
    ;   $Price = BinaryMid ( $ItemPacket, 50, 3 )
    ;   $ItemIDforSend = BinaryMid ( $ItemPacket, start, 3 )
    ;   If $Item = 111001000010001100011111 And $Price < 100101100000101 Then
    ;   $Send = TCPSend($Socket, 'F1 00 10' $ItemIDforSend)
    ;   EndIf
WEnd

Func Quit()
    Exit 0
EndFunc   ;==>Quit

I know I already had a topic like this, but I spammed the crap out of it and asked a lot of stupid questions. So I wanted to make a new one. Feel free to close/delete that other one. o.o

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...