libs-base/Testing/tcpport-server.m
mccallum c5f461d3a3 New file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1031 72102866-910b-0410-8b05-ffd578937521
1996-03-01 16:26:49 +00:00

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);
}