Skip to Content
Former Member
Dec 26, 2012 at 04:37 PM

winsock user object (deveolped by roland smith) worked first and now does not


I have posted a question on this topic before, I have to send data to one of oru .net app via a socket. I used winsock object dveloped by roland smith (team sybase) it worked perfectly and I was able to send data to the listening program but now suddenly it has stopped working. My coworker who is working on .net app has told me that nothing has changed on his side and I have not changed anything on my side. I am using roland's program as it is but now it has stopped working. I am using follwoing method exactly as it is in roland's example to create a scoket:

lul_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) following are the values when creating the socket

Constant Long AF_INET = 2

Constant Long SOMAXCONN = 2147483647

Constant Long SOCK_STREAM = 1

Constant Long SOCK_DGRAM = 2

Constant Long IPPROTO_TCP = 6

as you can see even the values passed to socket method are the same. I beleive the problem is in of_getsockopt method

Constant Long SOL_SOCKET = 65535
Long ll_optname, ll_optvalue, ll_buflen

ll_buflen = 4

choose case Upper(as_optname)
case "SO_ERROR"
ll_optname = 4103
case "SO_RCVBUF"
ll_optname = 4098
case "SO_SNDBUF"
ll_optname = 4097
case "SO_TYPE"
ll_optname = 4104
case else
end choose

// get option value
If getsockopt(aul_socket, SOL_SOCKET, &
ll_optname, ll_optvalue, ll_buflen) = 0 Then
Return ll_optvalue
End If

I beleive that .net program on the lsitening side has set some option that I am not setting on my side and then I call this of_getsockopt mehtod that returns an invalid value and because of that I am not able to write to the socket. Create socket and connect socket does not return any error message. Does the ll_buflen value has to correspond to some value set by the listening program? I am really desperate becuase nothing is working and it did work last week perfectly, I can't figure out what changed on which side? can someone help please?