benzrf Posted November 27, 2010 Share Posted November 27, 2010 I've been getting really weird results, if not errors, when I try to use the TCP functions. With something likeTCPStartup() $socket = TCPListen("192.168.1.3", 64432) MsgBox(0, @error, $socket)I get a msgbox with the caption "0" and the text "1688". ALWAYS. Even when I pick another port (except for ones that are already in use like 80 (I have an HTTP running)). I don't have any kind of program running that would do that. Unless... My father recently installed WebRoot. That couldn't be it, could it? Thanks in advance. Link to comment Share on other sites More sharing options...
Steveiwonder Posted November 27, 2010 Share Posted November 27, 2010 (edited) TCPStartup() $socket = TCPListen(@IPAddress1, 64432) MsgBox(0, @error, $socket) The return you are getting is normal. Its the socket identifier. What are you trying to achieve? Try this, and then open a cmd and "telnet 127.0.0.1 64432" - you'll see it works. TCPStartup() $socket = TCPListen("127.0.0.1", 64432) While True $conns = TCPAccept($socket) if $conns >= 0 Then MsgBox(0, "Connected", "Connection received") exit EndIf WEnd Edited November 27, 2010 by Steveiwonder They call me MrRegExpMan Link to comment Share on other sites More sharing options...
benzrf Posted November 27, 2010 Author Share Posted November 27, 2010 REALLY? In my experience, it keeps returning -1 until someone actually connects. **shrug** Ok. I'll try it ty Link to comment Share on other sites More sharing options...
Steveiwonder Posted November 27, 2010 Share Posted November 27, 2010 (edited) TCPListenReturn ValueSuccess: Returns main socket identifier. Failure: Returns -1 or 0 and set @error. @error: 1 IPAddr is incorrect. 2 port is incorrect. Edited November 27, 2010 by Steveiwonder They call me MrRegExpMan Link to comment Share on other sites More sharing options...
Tvern Posted November 27, 2010 Share Posted November 27, 2010 In my experience, it keeps returning -1 until someone actually connects.I believe you're thinking of TCPAccept(). 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