This is trans_tcp.m in view mode; [Download] [Up]
/* TCP Network Objects -- An Example of a Transmitter
by Ian Smith
of The Software Engineering Research Center's Multimedia Lab */
#import "tcp.m"
main ()
{
id foo;
int rt,mydata=3325;
char c;
foo = [network_tcp new];
/* substitute the recieving machine you wish to use below... it must directly
internet addressable and have a well-known name to the host using the object*/
rt = [foo call:"escher" onport:3325];
if (rt !=1) exit(1);
rt=[foo send_text:"foo bar gronk fronk"];
if (rt!=1) exit(1);
printf("press <return> to continue...\n");
scanf("%c",&c);
rt=[foo send_data:(void *)&mydata ofsize:sizeof(int)];
if (rt!=1) exit(1);
rt=[foo send_file:"/etc/hosts"];
if (rt!=1) exit(1);
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.