Problems Communication Socket Server Delphi Client CSharp

0

I have a need to implement socket-to-server communication in

asked by anonymous 04.09.2018 / 16:13

1 answer

0

I discovered that the problem was in the component I was using in delphi to create the server, I switched the TcpServer component to the SocketServer both from the Internet palette, the code was pretty much the same,

sRequisicao := Socket.ReceiveText;
Socket.SendText(sRequisicao);

And in the csharp part for ease I used the Socket package that made it easier to use

using (var socket = new ConnectedSocket("127.0.0.1", 6500)) 
{
     socket.Send("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><reserva><valor>10</valor></reserva>");
     var data = socket.Receive(); 
     Console.WriteLine(data);
}
    
04.09.2018 / 18:46