From: James Harrison Date: 2012-05-28T22:55:59+09:00 Subject: Where is tcpserver.c Included By socket.c? --20cf303a2bafd5e58904c119138c Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hey folks, I was reading the source to GServer recently and saw that the start method creates a new TCPServer: @tcpServer =3D TCPServer.new(@host,@port) I checked the includes and can see that there's socket and thread required. Of these two, only socket contains references to TCP. The requires for GServer are socket and thread, so I assumed this came from socket. I read socket.rb, though, and I didn=92t see a TCPServer definitio= n, so I checked its requires: it requires socket.so. I did a quick search for socket.c and found documentation in there that references TCPServer.new, but which doesn=92t seem to have any implementati= on that would recognise the name =93TCPServer.new=94. Socket.c includes rubyserver.h. Reading that, I saw these two lines: extern VALUE rb_cTCPServer; void rsock_init_tcpserver(void); So we=92re mentioning a tcpserver in an included library,. From here, I didn=92t know where to go.I did a search of the source tree fo= r tcpserver and found tcpserver.c. It also includes rubyserver.h, so presumably somewhere in that include is where the relationship between socket and tcpserver is created, but I can=92t see where. Could anyone give me a pointer to how to find out the relationship between socket.c and tcpserver.c? Thanks! Jams --20cf303a2bafd5e58904c119138c Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hey folks,

I was reading the source to GServer recently = and saw that the start method creates a new TCPServer:

=
=A0 =A0 =A0 @tcpServer =3D TCPServer.new(@host,@port)

I checked the includes and can see that there's socket and thread requi= red. Of these two, only socket contains references to TCP.

The requires for GServer are socket = and thread, so I assumed this came from socket. I read socket.rb, though, a= nd I =A0didn=92t see a TCPServer definition, so I checked its requires: it = requires socket.so.

I did a quick search for socket.c and found documentation in there that ref= erences TCPServer.new, but which doesn=92t seem to have any implementation = that would recognise the name =93TCPServer.new=94.

Socket.c includes rubyserver.h. Reading that, I saw these two lines:

extern VALUE rb_cTCPServer;

void rsock_init_tcpserver(void);

So we=92re mentioning a tcpserver= in an included library,.

From here, I didn=92t know where to go.I did a search of the source tree fo= r tcpserver and found tcpserver.c. It also includes rubyserver.h, so presum= ably somewhere in that include is where the relationship between socket and= tcpserver is created, but I can=92t see where.

Could anyone give me a pointer to how to find out the relationship be= tween socket.c and tcpserver.c?


Thanks!


Jams

--20cf303a2bafd5e58904c119138c--