Jump to content

Okay... TCP Connection


Recommended Posts

Okay, so here's the deal. I've looked at almost every TCP Thread yet, lol. But for some reason, this doesn't work for me.

Say I'm wanting a Game client to connect to a server:

I'm using this:

;Starting the TCP Server now:


; Included Files
; ==============================================
#include <SERVER_INFO.au3>



; Start Server Socket on port 8484 (Default Port)
; ==============================================
TCPStartUp()
$LOGIN_SERVER_SOCKET = TCPListen($LOGIN_SERVER_IP, $LOGIN_SERVER_PORT)
If $LOGIN_SERVER_SOCKET = -1 Then
    MsgBox(0,"Error","Failed to start TCP Server on: " & $LOGIN_SERVER_IP & ":" & $LOGIN_SERVER_PORT)
    Exit
EndIf
; Server Socket now created
; ==============================================

; Waiting for a client to connect
; ==============================================
$LOGIN_CONNECTED_SOCKET = -1

Do
  $LOGIN_CONNECTED_SOCKET = TCPAccept($LOGIN_SERVER_SOCKET)
Until $LOGIN_CONNECTED_SOCKET <> -1

MsgBox(1, "Connected", "New client Connected")

Okay, now here's the thing, After I start the client, this SHOULD show the Message box saying a new client has connected right?

I just started learning AutoIt, because I find it really interesting, so sorry if this is a stupid question, but I just wanted to know if I did something completely wrong.

Edited by SOChaos
Link to comment
Share on other sites

after your include statement, try this: (just an example)

$LOGIN_SERVER_IP = "192.1.1.100"

$LOGIN_SERVER_PORT = "1234"

edit: typo

Edited by iceberg

mouse not found....scroll any mouse to continue.

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...