mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-30 12:01:03 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1031 72102866-910b-0410-8b05-ffd578937521
21 lines
471 B
Objective-C
21 lines
471 B
Objective-C
#include <stdio.h>
|
|
#include <objects/TcpPort.h>
|
|
|
|
int main ()
|
|
{
|
|
id port;
|
|
id packet;
|
|
|
|
port = [TcpInPort newForReceivingFromRegisteredName: @"tcpport-test"];
|
|
|
|
while ((packet = [port receivePacketWithTimeout: 20 * 1000]))
|
|
{
|
|
fprintf (stdout, "received >");
|
|
fwrite ([packet streamBuffer], [packet streamEofPosition], 1, stdout);
|
|
fprintf (stdout, "<\n");
|
|
[packet release];
|
|
}
|
|
fprintf (stdout, "Timed out. Exiting.\n");
|
|
|
|
exit (0);
|
|
}
|