summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-05-22toss out everything that moved to glibHEADmasterSjoerd Simons23-4691/+4
2009-05-15Rearrange argument order so GCancellable is before GErrorAlexander Larsson2-7/+7
This is consistent with other APIs in gio.
2009-05-15Add docs for GSocketListener and subclassesAlexander Larsson2-5/+267
2009-05-15Make GSocketListener & co more in-line with glib styleAlexander Larsson7-32/+150
2009-05-15Add class padding and G_GNUC_CONST for get_type callsAlexander Larsson3-3/+11
2009-05-15Add docs and minor cleanups of GUnixConnection and GTcpConnectionAlexander Larsson4-104/+194
2009-05-15Make GSocketInput/OutputStream more in-line with glib styleAlexander Larsson4-19/+23
2009-05-15Add get_local/remote_address to GSocketConnectionAlexander Larsson2-1/+40
2009-05-15Add docs to GSocketConnectionAlexander Larsson2-14/+89
2009-05-15Add docs for GSocketClientAlexander Larsson2-44/+289
2009-05-15Add g_socket_client_connect_to_host_finishAlexander Larsson2-1/+12
Previously we re-used g_socket_client_connect_finish which works but doesn't follow the standard pattern.
2009-05-15Add getter and setters for GSocketClient propertiesAlexander Larsson2-14/+100
Also use setters for property changes so we get change notification on properties.
2009-05-15Remove unused includesAlexander Larsson1-6/+0
2009-05-15Use real enum GType for socket type propertyAlexander Larsson1-13/+8
2009-05-15Fix error handling in g_socket_client_connectAlexander Larsson1-9/+22
We want to report the error from last connect try if the g_socket_address_enumerator_next call returns no more adresses to try.
2009-05-15Don't build server.c, this test moved to glibAlexander Larsson1-4/+0
2009-05-15Update to the new GSocket API for with protocol as intAlexander Larsson7-37/+25
Also change the connection factory to use int protocols.
2009-05-14Use the GNetworkAddress parsing functionAlexander Larsson1-141/+3
g_network_address_new_from_string moved to glib as g_network_address_parse.
2009-05-14Merge branch 'master' into connection-factoryAlexander Larsson20-5414/+9
Conflicts: gio/Makefile.am gio/gsocket.c gio/gsocket.h gio/gsocketclient.c gio/gsocketlistener.c gio/gtcpclient.c gio/gtcplistener.c gio/gunixclient.c gio/gunixlistener.c
2009-05-14Update to the new GSocketSourceFunc prototypeAlexander Larsson4-11/+15
2009-05-14Use GSocket etc from gio, require new glibAlexander Larsson18-4760/+2
2009-05-14Make reuse address a bind argument instead of a settingAlexander Larsson5-128/+50
Since we can't always turn this on, but its almost always what you want for a server socket we make this an argument to bind. That way all users of bind (i.e. all server sockets and a few other users) need to decide on this and can set it.
2009-05-14Always use non-blocking sockets and emulate blocking mode for the APIAlexander Larsson1-96/+164
This avoids the issue where windows automatically enables nonblocking mode in various ways and sometimes makes it hard to get out of it. This way we provide a consistent cross platform API.
2009-05-13Update to use GIOStream from gioAlexander Larsson5-680/+2
GIOStream was added to gio, require a new glib and use it from there.
2009-05-12Add more GIOStream docsAlexander Larsson1-0/+39
2009-05-12Merge branch 'master' into connection-factoryAlexander Larsson11-186/+681
Trivial Conflicts: gio/gsocketconnection.c gio/gsocketconnection.h gio/gsocketoutputstream.c Also updated examples/httpd.c to not unref the streams from g_io_stream_get_input/output_stream.
2009-05-12Add method padding to GSocketAlexander Larsson1-0/+14
2009-05-12Turn GIOStream to a base classAlexander Larsson7-167/+649
Makes GIOStream a class, same as GInput/OutputStream Moves close to GIOStream, add close_async Make stream getters not ref
2009-05-12Don't call things input_stream in the output streamAlexander Larsson1-12/+12
2009-05-11Stop socket service when thread pool is fullAlexander Larsson1-0/+17
This way we won't accept any new sockets when we're not processing the currently executing ones.
2009-05-11Add start/stop to GSocketServiceAlexander Larsson2-13/+92
This lets users and subclasses stop processing of the accept sockets.
2009-05-11Rename active to outstanding_acceptAlexander Larsson1-3/+3
2009-05-11Add g_socket_listener_set_backlogAlexander Larsson2-0/+81
2009-05-11Add http server exampleAlexander Larsson2-1/+189
2009-05-11Use a thread pool in GThreadedSocketServiceAlexander Larsson1-6/+50
2009-05-11Add source_object to the GSocketListener sourcesAlexander Larsson7-41/+75
Apps can use this if they want to differentiate between different sources. It is a GObject so that we can ref and unref it in a threadsafe way.
2009-05-11Add back support for host:port style hostnamesAlexander Larsson1-16/+187
g_socket_client_connect_to_host[_async] now supports passing port in the host string. This adds a local g_network_address_new_from_string() which should maybe be added to gnetworkaddress.c.
2009-05-11Correctly handle errors on commit in GSocketClientAlexander Larsson1-16/+2
On error we return G_IO_ERR, not G_IO_IN, so we need to handle this.
2009-05-09Make GSocketService inherit from GSocketListenerAlexander Larsson7-86/+92
2009-05-09Re-imagining GSocketListenerAlexander Larsson10-566/+405
We now support multiple sockets in each listener. This way we can handle the ipv6+ipv4 linux vs non-linux issue nicely (you need 1 socket on linux, 2 on other platforms). We also remove the not very useful subclasses by pushing socket factory to the base class and adding a helper function for the inet port case. We also add support for listening and then accepting a socket, instead of always getting a connection, as this may be useful in some cases. examples/server.c is updated to work with the new APIs
2009-05-09Fix locking deadlock on connection factoryAlexander Larsson1-2/+2
2009-05-09Pass source GSocket to GSocketSourceFuncAlexander Larsson8-26/+60
This is very useful when you have several sources and want to know which originating socket fired.
2009-05-08Remove last mentions of "domain", its really "family"Alexander Larsson1-4/+4
I dunno why socket() calls the first argument "domain" when its called family everywhere else, but don't leak that into gnio.
2009-05-08Don't leak GSocket->priv->protocolAlexander Larsson1-0/+2
2009-05-08Add g_socket_connecton_get_socketAlexander Larsson2-0/+9
2009-05-08Remove GTcpClient and GUnixClientAlexander Larsson6-721/+0
These classes are now very minimal helpers that avoid some casting and hides the constructing of an intermediate GSocketConnectable The casting is imho not necessary, since in most cases a GSocketClient is what you use, even if you later may want to downcast to some other connection type. All the extra classes and code to avoid constructing the intermediate connectable are imho misguided. The really common helper now exists as g_socket_client_connect_to_host(_async), and the rest just explodes the API with seldom used functions that removes the nice connectable abstraction.
2009-05-08Use g_socket_client_connect_to_host instead of g_tcp_client_..Alexander Larsson1-9/+9
2009-05-08Add connect to host helper functionsAlexander Larsson2-0/+90
Connecting to an hostname/ip with a port is the only really often used helper, so push it to g_socket_client.
2009-05-08Add g_socket_client_new()Alexander Larsson2-0/+8
2009-05-08Simplify GTcpClientAlexander Larsson3-308/+16
Don't allow ports in the hostname, this looks kinda dangerous as its easy for apps to not be aware the the hostname can have a port, and it doesn't fit well with how ports seem to be used in non-commandline apps. Pass port as int, don't allow lookup by name. Lookup by name is not reliable since using it for any newish protocol would mean you need to do an "os update" to get it working (i.e. update to /etc/services). But ports are a public ABI anyway, so you might as well hardcode them in apps so it always works. g_network_service_new and g_network_service_new always succeeds