Re: Sockets and g_io_channel
- From: Juan Agüí <jagui die upm es>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: Sockets and g_io_channel
- Date: 08 Nov 2002 08:28:52 +0100
El jue, 07-11-2002 a las 15:50, Harring Figueiredo escribió:
Juan,
Just out of curiosity, have you looked at gnet library ?
HArring.
Great library for working software projects. But my program is for
academic purposes, so gnet calls can make the source code pretty
illegible for a novice.
--- Juan Agüí <jagui die upm es> wrote:
Sorry, no subject in previous message...
Hi everyone!
I developing an OSI protocol stack. I need one layer to communicate with
another through a socket. The server application will be the Link Layer
and the client application will be the Application Layer.
The server waits for incoming datagrams listening on the socket and the
client writes datagrams in the socket. Both are programmed in gtk+2 as
they need GUI capability. There's not much info about g_io_channel and
socket, so please tell me if this approach is wrong:
Server:
1)Create a socket: sock=socket(..)
2) Bind it to a port: bind(...)
3) Make it listen: listen(...)
4) Create a g_io_channel: fd=g_io_channel_new(sock)
5) Add a watch to the io_channel to act in response of incoming
datagrams
Client:
1)Create a socket: sock=socket(..)
2)Create io_channel
3) ¿Should i call "connect"
4) write to the io_channel
Im getting this runtime error: "GLib-CRITICAL **: file giochannel.c:
line 1914 (g_io_channel_write_chars): assertion `channel->is_writeable'
failed"
Suggestions? Thanks in advance.
--
Juan Agüí Martín
ETSI Telecomunicación
C. Universitaria S/N Dpcho B-205
Madrid 28050 Spain
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
Juan Agüí Martín
ETSI Telecomunicación
C. Universitaria S/N Dpcho B-205
Madrid 28050 Spain
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]