02-14-2015, 02:07 AM
I was playing with the network API, but I can't find a way to close a TCPLink's connection.
Network API
|
||||
02-14-2015, 02:07 AM
I was playing with the network API, but I can't find a way to close a TCPLink's connection.
02-14-2015, 02:21 AM
Yes, I forgot about that. Will fix tonight on train back to prague.
Thanks given by: NiLSPACE
02-14-2015, 02:29 AM
Thanks in advance
![]()
02-14-2015, 08:23 AM
Close() is implemented; Shutdown() is somewhat problematic - LibEvent keeps the data in a buffer, so when you shut down a socket, you lose whatever LibEvent hasn't sent yet. I'm trying to find a solution to this, because it affects all connections a lot.
Thanks given by: NiLSPACE
I really like the network API
![]() I even found a use for Lua Coroutines ;D
Made a simple login/logout page:
Is it possible that the cTCPLink:Close function closes the connection before some data that was send is received? I now have to use
Because otherwise the browser won't receive anything. Oh I see in the APIDesc file that I have to use cTCPLink:Shutdown because cTCPLink:Close could do exacly what I just mentioned ![]()
02-15-2015, 11:54 PM
Exactly
![]()
02-16-2015, 12:12 AM
I'm thinking about UDP support. Since UDP doesn't have the concept of a persistent connection, I think the only interface needed would be an "Endpoint", which can be attached to a port number and either receive or send UDP datagrams.
The interface: - cNetwork:CreateUDPEndpoint(Port, UDPCallbacks) -> cUDPEndpoint object cUDPEndpoint methods: - IsOpen() - GetPort() - Send(Data, Host, Port) - sends a datagram with the specified data payload to the specified host/port - EnableBroadcasts() - enables the endpoint to send broadcasts (using special host/port combinations) - Close() UDPCallbacks: - OnError(ErrorCode, ErrorMsg) - OnReceivedData(Data, Host, Port) - A datagram with the specified Data payload has been received from the specified host/port
02-16-2015, 01:45 AM
Sounds good.
| ||||
« Next Oldest | Next Newest »
|