/* Arguments : s - channel number addr - destination IP Address port - destination Port Number Returns : when succeeded : 1, failed : -1 Note : API Function  */
char NBconnect(SOCKET s, u_char far *addr, u_int port)
/* Arguments : s - channel number addr - destination IP Address port - destination Port Number Returns : when succeeded : 1, failed : -1 Note : API Function  */
char NBconnect(SOCKET s, u_char far *addr, u_int port)
{
if (port != 0)
  {
	WRITE_VALUE(DST_PORT_PTR(s), (u_char) ((port & 0xff00) >> 8) );
   WRITE_VALUE(DST_PORT_PTR(s) + SA_OFFSET(1), (u_char)(port & 0x00ff));
  }
else
  return(-1);
  WRITE_VALUE(DST_IP_PTR(s), addr[0]);
  WRITE_VALUE(DST_IP_PTR(s) + SA_OFFSET(1), addr[1]);
  WRITE_VALUE(DST_IP_PTR(s) + SA_OFFSET(2), addr[2]);
  WRITE_VALUE(DST_IP_PTR(s) + SA_OFFSET(3), addr[3]);
I_STATUS[s] = 0;
WRITE_VALUE(COMMAND(s), CCONNECT);
return(1);
}