Jump to content

TCP Help


Recommended Posts

Hey guys, I am working on something to help me better understand how TCP works. I am having a lot of trouble. I have looked at many examples and thought I figured it out and still nothing.

I was wondering if someone can send me an example that would use all the TCP functions. Make it super simple please. I have looked at that chat server/client and it is just so confusing.

I have made a server/client chatting thing but the client can not reconnect when it is restarted???

Thank you guys so much, I just want to figure this out once and for all.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Check my posts. TCP Made easy is very simple. I also made a SIMPLE example... Pretty much as simple as it gets in my topic in my signature.

TCP Server Example and TCP Client Example at the bottom of the first post.

Servers:

TCPStartUp

TCPListen

TCPAccept

TCPRecv

TCPSend

TCPCloseSocket

TCPShutdown

Clients:

TCPStartup

TCPConnect

TCPRecv

TCPSend

TCPCloseSocket

TCPShutdown

I hope you can figure it out, for more indepth help, message me.

Link to comment
Share on other sites

TCP Server:

Always run servers first.

You might want to use and edit this function to check on currently connected client. Add this to the server and edit it according to your variables.

AdlibEnable("UpdateSocket", 2000)
;....At Bottom
Func UpdateSocket()
If TCPSend($ConnectedSocket, "~test") = 0 Then $ConnectedSocket = TCPCloseSocket($ConnectedSocket)
EndFunc

Also make $ConnectedSocket a GLOBAL variable and set it on the return of TCPCloseSocket.

For the client add something like:

If $Data <> "" and  $Data <> "~test"
;Continue.....
EndIf

That may help.

Edited by AutoIt Smith
Link to comment
Share on other sites

Thanks a lot. I forgot this topic. this show help a lot.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/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...