Welcome! Log In Create A New Profile

Advanced

Using Sockets with .NET Client

Posted by Robin Lane.pcs.crosspost 
Robin Lane.pcs.crosspost
Using Sockets with .NET Client
May 25, 2009 12:03PM
Hello All,

I am having great difficulty with trying to get Sockets to work with a .NET client. I have no problems with my WinDev server communicating with a WinDev client, nor a .NET server with a .NET client. I can even get a WinDev client to send messages to a .NET server.

What I cannot achieve is for my WinDev server to receive messages sent from a .NET client.

I do know that the .NET client is making a connection via the Socket because I can access SocketClientInfo and get the .NET client’s IP address, but all my attempts to get something from SocketRead fail.

Without producing all my code below on my WinDev server I first use CreateSocket, then SocketAccept and then use SocketRead. This works fine when the client is another WinDev application. My .NET client code is shown below:

First create the socket:

Socket m_socWorker = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);

Send data via:

byte[] byData = System.Text.Encoding.ASCII.GetBytes(txtData.Text.ToString ());
m_socWorker.Send (byData);


On the WinDev server I have tried altering the SocketChangeTransmissionMode to SocketNoEndTag, and have also played with changing the .NET encoding type to UTF8 & Unicode, but still the WinDev server does not receive any data.

Can anybody assist me with this?

(I am currently using version 12, but will be updating in the next week or so.)

Many thanks

Robin.


Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: