mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-30 03:50:46 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1031 72102866-910b-0410-8b05-ffd578937521
25 lines
500 B
Objective-C
25 lines
500 B
Objective-C
#include <stdio.h>
|
|
#include <objects/TcpPort.h>
|
|
|
|
int main ()
|
|
{
|
|
id port;
|
|
id packet;
|
|
int i;
|
|
|
|
port = [TcpOutPort newForSendingToRegisteredName: @"tcpport-test"
|
|
onHost: @"localhost"];
|
|
|
|
for (i = 0; i < 5; i++)
|
|
{
|
|
packet = [[TcpPacket alloc] initForSendingWithCapacity: 100
|
|
replyPort: nil];
|
|
[packet writeFormat: @"Here is message number %d\n", i];
|
|
[port sendPacket: packet withTimeout: 20 * 1000];
|
|
[packet release];
|
|
}
|
|
|
|
[port close];
|
|
|
|
exit (0);
|
|
}
|