1. Winsock Wrapper (Winsock.ew) not working on WsockSendData?
- Posted by RedWordSmith <redwordsmith at NIC.DREAMHOST.COM> Sep 04, 1999
- 408 views
Hello, I've been having trouble working with a simple program to automate the process of a large number of FAQ posts to USENET. Most of the underlying structure has already been written, but I can't get the program to actually communicate with my newserver (I've had no trouble with a Telnet client). It's had me scratching my head for quite awhile now. Here's the code I've been using to try to test the connection: -- Start here include Winsock.ew SocketTrace = 1 object newserver,socketcommand newserver = "127.0.0.1" -- This is my actual newserver in my copy... socketcommand = WsockInit() socketcommand = WsockCallSocket(newserver,119) -- connects to the server. This much works, I can see the connection in -- Netstat socketcommand = WsockSendData(119, "mode reader\r") -- WsockSendData ends up returning an error on this. -- The comments in Winsock.ew call this -- "Fubar'ed really badly" socketcommand = WsockReadData(119,1024) -- Also doesn't work, but then again, without a command -- The server shouldn't be returning data. puts(1, socketcommand) -- Obviously doesn't print out anything. Should be: -- 200 Server Banner - Posting Ok -- The socket is closed later in the program, and the server is "quit". -- End program Am I overlooking something obvious? o_O -- RWS
2. Re: Winsock Wrapper (Winsock.ew) not working on WsockSendData?
- Posted by RedWordSmith <redwordsmith at NIC.DREAMHOST.COM> Sep 11, 1999
- 428 views
RedWordSmith wrote: > > socketcommand = WsockSendData(119, "mode reader\r") > -- WsockSendData ends up returning an error on this. > -- The comments in Winsock.ew call this > -- "Fubar'ed really badly" After carefully reviewing everything, I've discovered my mistake (some of you may have just rolled your eyes and seen this immediately, but it doesn't seem to be archived, so I might as well explain it). The problem with the above code is that I'm basically trying to send "mode reader\r" *from* socket 119, which isn't connected to anything. "119" needs to be replaced by the value returned by "WsockCallSocket", which is the actual _local_ socket. I have to admit, I'm embarrassed it took me a week or so to notice that... > Am I overlooking something obvious? o_O > > -- > RWS