struct v3_socket_hooks * sock_hooks = 0;
-//static int v3_socket_api_test(void);
+//int v3_socket_api_test(void);
void V3_Init_Sockets(struct v3_socket_hooks * hooks) {
}
#if 0
-static int
+
+int
v3_socket_api_test(void)
{
unsigned int port;
PrintDebug("\nIn Palacios: Test V3_Socket Macros\n");
sock = V3_Create_TCP_Socket();
- if( sock == NULL ){
+ if( ((int)sock) < 0 ){
PrintDebug( "ERROR: tcp_socket() failed!\n");
return -1;
}
PrintDebug( "Going into mainloop: server listening on port %d\n", port);
- client = V3_Accept_Socket(sock, &remote_ip , &port);
+ client = V3_Accept_Socket(sock, &remote_ip, &port);
PrintDebug(" New connection from %d port: %d\n", remote_ip, port);
while(1)
{
V3_Send(client, buf, rc);
- rc = V3_Recv(client, buf, sizeof(buf)-1);
+ rc = V3_Recv(client, buf, sizeof(buf)-1);
if( rc <= 0 ){
PrintDebug( "Closed connection\n");
V3_Close_Socket(client);
#endif
+
#if 0
static int