Jump to content

TCP Help.


AzKay
 Share

Recommended Posts

Client

TCPStartup()
$ip = InputBox("IP", "Enter IP to connect to", @IPAddress1)
$port = InputBox("Port", "What port are they using?", "5900")
$con = TCPConnect($ip, $port)

If @error Or $con < 1 Then
    MsgBox(0, "Error", "Could not Connect")
    Exit
EndIf

While 1
    TCPSend($con, InputBox("", ""))
WEnd

Few questions,

1, How can I have this so multiple people can connect? ~ Found the answer Here

2, How can I have the server reply back to the client?

eg; Client > Server "Hello", Server > Client "OK"

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Case StringLeft($msg, 5) = "[300]" ;Login
                $oCommand = StringTrimLeft($msg, 5)
                $oParam = StringSplit($oCommand, ",")
                If IsArray($oParam) Then
                    MsgBox(0, "Login", $oParam[1] & ":" & $oParam[2])
                EndIf
tcpsend($con,'OK');answer

You can use the same connection started by client to send a message.

A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza รจ il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]
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...