Skip to Content
0
Former Member
Dec 11, 2012 at 03:44 PM

ws2_32.dll to write to a socket

267 Views

the following is my post from PowerBuilder forum on Sybase, where we all PB lovers got our answers for so long. I thought I will post my entire discussion here as well in case everybody is now connected to SCN. If any one had any experience with this it would be great

As I mentioned I will keep looking myself as well and I did find some answers:

ws2_32.dll in syswow64 folder under window folder is although named ws2_32.dll but it is actually 64 bit app and depending on the windows os i m using the correct version of this dll will be used.

I also found out that only binary data can be written to ports and I will have to convert the string to blob before I send it via sendto method to the socket client will be listening on.

.net does have capability to convert blob to string

despite my answers it would be nice if someone who had some experience with this can also chime in, would be of great help.

I will also post this in scn

> I have a pb app that will have to communicate with an app

> that is written in .net/c# via socket communication. I am

> using send and sendto methods of ws2_32.dll which is built

> for socket communication. The problem is that send and

> sendto only have option of sending data in blob and not

> ascii string. I do not think that sending a string would

> be possible since there is no method that can do that, at

> least not in this dll. Now i m going to ask a dumb

> question but i have to ask it, does the blob datatype in

> pb only converts the ascii string to binary and that is

> all, and if it does I am pretty sure the app on .net side

> can convert the binary data bk to string and nothing will

> b lost? is my assumption correct? I am pretty sure .net

> has some class that can take binary and convert to string.

> Just curious why ws2_32.dll does not have method to

> transfer string and only binary? is ascii string transfer

> inefficient is that why? also if I do use this dll

> ws2_32.dll and I am using PB 12.5 build 2511 will I run

> into any 32 bit vs 64 bit issue? I would like to know b4 I

> develop a solution. is there something like 64 bit verison

> of this dll? I am doing my own research as well and i will

> report back