poisonkiller Posted November 17, 2005 Share Posted November 17, 2005 (edited) First i need TCP connection for listen and if something like "string" comes from server, then first TCP closes and another starts on another IP. Ok i try to do example: TCPStartup() $connectedSocket = TCPConnect("First IP", 666) $MainSocket = TCPListen("First IP", 666) While 1 Do $ConnectedSocket = TCPAccept($MainSocket) Until $ConnectedSocket > 0 $err = 0 Do $msg = TCPRecv($ConnectedSocket,512) $err = @error If $msg = "string" Then ;TCPCloseSocket($ConnectedSocket) I dont know if i need this ;Here i need a new TCP connection with IP address "Second IP" and port 666 EndIf Until $err TCPCloseSocket($ConnectedSocket) Wend TCPShutdown() I hope someone understand what i need! Thanks! EDIT: I solved my problem Edited November 17, 2005 by poisonkiller Link to comment Share on other sites More sharing options...
themax90 Posted November 18, 2005 Share Posted November 18, 2005 TCPStartup() $ConnectedSocket = TCPConnect("First IP", 666) $MainSocket = TCPListen("First IP", 666) While 1 Do $MainSocket = TCPAccept($MainSocket) Until $ConnectedSocket > 0 $err = 0 Do $msg = TCPRecv($MainSocket,512) $err = @error $msg = StringSplit($msg, "-") If $msg[1] = "~newconnect" Then TCPCloseSocket($ConnectedSocket) TCPOpen($msg[2], 666) EndIf Until $err TCPCloseSocket($ConnectedSocket) TCPCloseSocket($MainSocket) Wend TCPShutdown() Is this what you would like? Syntax is ~newconnect-(IpAddress) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now