amiga-bsdsocket-coding/server_in_c/test_setup.c

22 lines
459 B
C
Raw Normal View History

2023-01-11 13:03:46 +00:00
#include <proto/exec.h>
#include <dos/dos.h>
#include <proto/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
int main(void) {
if (!(SocketBase = OpenLibrary("bsdsocket.library", 4))) {
printf("Can't open socket library\n");
return 1;
}
serverSocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (serverSocket < 0) {
printf("can't get a socket\n");
return 1;
}
CloseSocket(serverSocket);
CloseLibrary(SocketBase);
}