Jump to content
Sign in to follow this  
z0mgItsJohn

TCP Question

Recommended Posts

z0mgItsJohn

Well.. I Wanted To Know If There Was A Way I Could... Know If A "Client" Has Disconnected Without Sending It A Message... Because I'm Working On A "Packet Filter" And I Need A Way To Know If A Client Has Disconnected And In Order To Send It A Message I Have To Make The Right Packet Structure =X

~ Thanks In Advance (Even If You Can't Help, But Tried) ~

- John


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites
rasim

This?

;In a server script
$recv = TCPRecv($Connect, 2048)
If @error Then MsgBox(16, "Client error", "")

Share this post


Link to post
Share on other sites
z0mgItsJohn

Oh.. Lol.. I Didnt Think That Would Work.. Because Under Return Value For "TcpRecv" In The Help File It Says

"Return Value

Success: Returns binary/string sent by the connected socket.

Failure: Returns "" and set @error according to Windows API WSAGetError return. "

And I Thought It Set @Error If There Was No Msg Recv'd But Thanks! It Works Like A Charm 8D


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites
yucatan

Oh.. Lol.. I Didnt Think That Would Work.. Because Under Return Value For "TcpRecv" In The Help File It Says

"Return Value

Success: Returns binary/string sent by the connected socket.

Failure: Returns "" and set @error according to Windows API WSAGetError return. "

And I Thought It Set @Error If There Was No Msg Recv'd But Thanks! It Works Like A Charm 8D

in the client u can set the func onautoitexit() when the client script closes he run that func and then close the .exe

so in the onautoitexit () func u can set tcp filewritetolog $socket has been disconnecting or something liek that

u can let the clinet send something that the server know that that client is disconnected.

Share this post


Link to post
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
Sign in to follow this  

×