Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Visual Prolog 5.2 sockets interface

1 view
Skip to first unread message

Iscando

unread,
Aug 21, 2001, 5:04:07 PM8/21/01
to
Hello:
I spent to much time on AI programming and not enough on networking.
Does anyone have any working examples of the sockbind predicates in VP 5.2?
I have the following code working.
--------------------------
%BEGIN Task Window, e_Create
task_win_eh(_Win,e_Create(_),0):-!,
win_EnableHook(_Win, b_True), /* enable the e_native events */

Version = 0x101, %application uses Windows Sockets API 1.1
sck_StartUp(Version,_IniData,ReturnCode),
assert(xxsockx(ReturnCode)),
Socket = sck_socket(af_inet,sock_Stream,ipproto_tcp),
AddrIN = sck_InetAddr("192.168.10.32"), /* LAN address */
Hport = sck_ntohs(1520),
Addr = sck_MergeAddress_IN(af_inet,Hport,AddrIN),
sck_Bind(Socket,Addr),
sck_Listen(Socket,1),
assert(xnewsock("(1520) the socket ",Socket," is listening at port ",Hport)),

assert(xwinall("task_win",_Win,1)), /* task window handle */
assert(xwindowcounter(1)), /* remove and inc when next window is installed
*/
assert(xfocuslast(_Win)), /* remove and replace when next win gets focus */
-------------------------------------------------------------------------
I need to see examples of sck_accept / sck_connect / sck_send
The simpler the examples are the better.
PDC does not have examples of these predicates.
Can anybody out there prove to me that they actually work.
Thank you jo...@iscando.com or isc...@aol.com
0 new messages