Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Example for using tcp socket

8 views
Skip to first unread message

Andreas Bollhalder

unread,
Jun 28, 2006, 3:21:54 PM6/28/06
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all

Is there an example around, how I can use the socket for connecting to a
server on a specified port and retrieve data from it ? Surely in GOC...

Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEotbSkyKr2gmercERAm9+AKDLlChuxVJhgfw0Cz+MHTTFYqemfQCfcckr
yD9EEDjgnJOMpjT+JwDOEt0=
=5WYs
-----END PGP SIGNATURE-----

Andreas Bollhalder

unread,
Jun 29, 2006, 3:25:32 PM6/29/06
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Redefined my question :

When I have the ip address and the port, how can I set the IP directly
in the SocketAddress variable for the method SocketConnect ?

I have the following:

SocketAddress addr;
Socket sock;
word err;

addr.RTA_sock.SA_port.SP_port = 123;
addr.RTA_sock.SA_port.SP_manuf = MANUFACTURER_ID_SOCKET_16BIT_PORT;

sock = SocketCreate(SDT_DATAGRAM);
err = SocketConnect(sock, &addr, 600);

Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEpCkskyKr2gmercERAnUOAKDQ9SOFHMRuh1t85XhapU9RlUmGaQCfVaMo
P8J43CPpuuXxmIvGLeIqg5o=
=dBlg
-----END PGP SIGNATURE-----

0 new messages