+ function SendTo(Sock: LongInt; const Buf;BufLen: LongInt;Flags: LongInt;var Addr;AddrLen: LongInt):LongInt;\r
+ begin\r
+ result := fpsendto(sock,@buf,buflen,flags,@addr,addrlen);\r
+ end;\r
+ function RecvFrom(Sock: LongInt;var Buf;Buflen: LongInt;Flags: LongInt;var Addr;var addrlen: Longint):LongInt;\r
+ begin\r
+ result := fprecvfrom(sock,@buf,buflen,flags,@addr,@addrlen);\r
+ end;\r
+ {$define socket := fpsocket}\r
+ function Bind(Sock: LongInt;const Addr;AddrLen: LongInt):Boolean;\r
+ begin\r
+ result := fpbind(sock,@addr,addrlen) = 0;\r
+ end;\r
+ function SetSocketOptions(Sock: LongInt;Level: LongInt;OptName: LongInt;const OptVal;optlen: LongInt):LongInt;\r
+ begin\r
+ result := fpsetsockopt(sock,level,optname,@optval,optlen);\r
+ end;\r
+ function Connect(Sock: LongInt;const Addr;Addrlen: LongInt):Boolean;\r
+ begin\r
+ result := fpconnect(sock,@addr,addrlen) >= 0;\r
+ end;\r
+ function listen(Sock: LongInt;MaxConnect: LongInt):Boolean;\r
+ begin\r
+ result := fplisten(sock,maxconnect) = 0;\r
+ end; \r
+ function GetPeerName(Sock: LongInt; var Addr;var Addrlen: LongInt):LongInt;\r
+ begin\r
+ result := fpgetpeername(sock,@addr,@addrlen);\r
+ end;\r
+ function GetSocketName(Sock: LongInt; var Addr;var Addrlen: LongInt):LongInt;\r
+ begin\r
+ result := fpgetpeername(sock,@addr,@addrlen);\r
+ end;\r
+ function Accept(Sock: LongInt; var Addr; var Addrlen: LongInt):LongInt;\r
+ begin\r
+ result := fpaccept(sock,@addr,@addrlen);\r
+ end;\r