From 43e0468a233a49b1010f34c5ce888204fa4e9416 Mon Sep 17 00:00:00 2001 From: Robert Förster Date: Fri, 21 Nov 2014 14:34:32 +0000 Subject: - massive trailing whitespace cleanup (yes, one of these "you can hate me for that" commits) - apply patch by d00p: show the correct protocol version instead of just "SSLv3/TLSv1", thanks! - fix compilation on qt 5.4 on windows git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6398 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/objects/KvsObject_socket.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/modules/objects/KvsObject_socket.cpp') diff --git a/src/modules/objects/KvsObject_socket.cpp b/src/modules/objects/KvsObject_socket.cpp index 571aff749..98cb3d217 100644 --- a/src/modules/objects/KvsObject_socket.cpp +++ b/src/modules/objects/KvsObject_socket.cpp @@ -109,7 +109,7 @@ const char * const sockerrors_tbl[] = { 4=Bound[br] 5=Closing[br] 6=Listening - + !fn: $connect(,) Attempts a connection to on port .[br] can be a numeric internet address (either Ipv4 or Ipv6 (if supported)) or a hostname.[br] @@ -124,7 +124,7 @@ const char * const sockerrors_tbl[] = { and you will be notified of the attempt result by an asynchronous event call: in case of failure, $connectFailedEvent() will be called, in case of succes, $connectEvent() will be called. - + !fn: $listen([[,[,]]]) Attempts to listen on the specified and .[br] If is not passed it is assumed to be 0, if is not passed, it is assumed to be @@ -136,14 +136,14 @@ const char * const sockerrors_tbl[] = { On some systems listening in the IPV6 namespace allows to accept also IPV4 connections (this includes linux but not windows afaik).[br] When an incoming connection will arrive, $incomingConnectionEvent() will be called. - + !fn: $connectedEvent() This function is called when a connection attempt has been successfully completed. The socket is actually connected to [classfnc:socket]$remoteIp[/classfnc]() on [classfnc:socket]$remotePort[/classfnc](). You can start writing data and you may expect [classfnc:socket]$dataAvailableEvent[/classfnc]() to be triggered. - + !fn: $incomingConnectionEvent() This function is called when an incoming connection arrives over a socket in listening state.[br] You must return 1 if you to terminad this incoming connectioncall [classfnc:socket]$accept[/classfnc]() passing a newly created socket object @@ -165,14 +165,14 @@ const char * const sockerrors_tbl[] = { This function is called when some data is available to be read: the parameter specifies the length of the available data in bytes.[br] You can use one of the $read* functions to obtain the data - + !fn: $read([,]) Reads at most bytes of data from the socket. If is anything "outside" the available data range ( < 0 or > available_data_length), this function returns all the available data.[br] By default this function can deal ascii data only: NULL characters are transformed to ASCII characters 255. You can pass a [class]memorybuffer[/class] object to read binary data. - + !fn: $write([,length]) Writes to the socket.[br] This function can deal with binary data passing a [class]memorybuffer[/class] object[br] @@ -182,7 +182,7 @@ const char * const sockerrors_tbl[] = { Using an array you can pass bytes or data string like this: @$write($array($(0xff),$(0xff),$(0xff),$(0xff),"This is an example")); If you're going to [cmd]delete[/cmd] this object just after the $write call, you should call [classfnc:socket]$close[/classfnc]() just before [cmd]delete[/cmd] to ensure the data delivery. - + !fn: $close() Resets this socket state: kills any pending or active connection. After a close() call the socket may be used for a new connection.[br] @@ -190,22 +190,22 @@ const char * const sockerrors_tbl[] = { You don't need to call $close() if you [cmd]delete[/cmd] the socket: KVIrc will reset the socket state automatically and free the memory. But if you want to ensure data delivery after a $write call sequece and just before a [cmd]delete[/cmd], $close() is the only chance to do it. - + !fn: $remoteIp() Returns the IP address of the remote end of this socket.[br] The return value is meaningful only if the socket is in connected or connecting state. - + !fn: $setProtocol() Let KVIrc use TCP or UDP protocol - + !fn: $remotePort() Returns the port of the remote end of this socket.[br] The return value is meaningful only if the socket is in connected or connecting state. - + !fn: $localIp() Returns the IP address of the local end of this socket.[br] The return value is meaningful only if the socket is in connected, listening or connecting state. - + !fn: $localPort() Returns the port of the local end of this socket.[br] The return value is meaningful only if the socket is in connected, listening or connecting state. -- cgit v1.3.1-10-gc9f91