Sockets
-
Help !!!! I am trying to get some data out of a piece of equipement via our network, using windows sockets. Does anybody have any code which shows very easily how to connect to a ip address + port and send and receive data from it. I have tried the examples from MSDN and it only gets as far as the Bind() then fails. Any ideas ? Adrian
-
Help !!!! I am trying to get some data out of a piece of equipement via our network, using windows sockets. Does anybody have any code which shows very easily how to connect to a ip address + port and send and receive data from it. I have tried the examples from MSDN and it only gets as far as the Bind() then fails. Any ideas ? Adrian
Hi I've put some source code below. It'snot complete... But it should give you a start Nish
CSocket s;
s.Create();
s.Connect("127.0.0.1",25);
CString buff;
buff="helo buster\r\n";
s.Send(buff,buff.GetLength());
char rbuff[128];
s.Receive(rbuff,64,0);
buff=rbuff;
s.Close(); -
Help !!!! I am trying to get some data out of a piece of equipement via our network, using windows sockets. Does anybody have any code which shows very easily how to connect to a ip address + port and send and receive data from it. I have tried the examples from MSDN and it only gets as far as the Bind() then fails. Any ideas ? Adrian
See the basic examples section of the Winsock Programmes's FAQ