473,692 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Socket programming questions

Hi all,
I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic.
My programming environment is Windows XP, Visual Studio .NET 2003 and C#.
So here it goes. I have been able to set up async sockets that listen to a particulare port with Bind and Listen and accept connections with Socket.BeginAcc ept and Socket.EndAccep t. The class also listens with the Socket.BeginRec eive and Socket.EndRecei ve functions. I also use the ManualResetEven t to signal finished states between the various async functions. I am using a custom developed collection class to hold connected sockets that are retreived on the call to Socket.EndConne ct in the SocketConnectCa llback function. I understand how to do all this. Where my failure of understanding comes in, is when I want to send data. I want to send data from the same socket that I am listening on. So let's say I have a class that controls the starting and stopping of a listening socket. This class also has a custom developed class that is a collection of sockets stored by the hash of the RemoteEndPoint that it is connected to. I first check to see if the collection contains a current connection to the endpoint that I want to send data to. If it does, grab that socket which is already connected and do a BeginSend on it with the data I want to send. Here is where I get confused. If a socket with the endpoint that I want to send data to does not exist, I want to connect to a remote system using the port of the socket that I am currently listening on. Either using the blocking Connect or the async BeginConnect, preferably the later. When I attempt to do this I get a System.SystemEx ception {"An invalid argument was supplied"}. Now if I create a new socket with the same AddressFamily, etc and do a BeginConnect, it picks up a new port and connects to the remote system and then I can send data on that socket. I understand that this is an option but not the option that I want.
What am I overlooking or misunderstandin g here? The reason why I want to connect from a specific port is because I am writing a P2P app that tracks all clients by a given address and port. If my approach is not valid I am going to have to drop back, punt and rethink.... :).
Thanks for any/all help that you may be able to provide.

John

Nov 16 '05 #1
5 3679
John,

If I understand you correctly I don't think what you want to do is possible. The socket that is listening on a particular port can only connect and communicate with a client when the client initiates the connection. After a connection is established then either the server or client can send and receive data via the socket. However, it is not possible to connect to a remote computer using the same socket that you are listening on. That isn't a limitation of .Net or C#; it's just the way sockets work.

I'm still a little curious why the port would need to be the same on the server when it wants to initiate sending data to a remote computer that has not previously made a connection. Why is that a hard requirement?

good luck... hope this helps some,

~harris

"John Sheppard" wrote:
Hi all,
I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic.
My programming environment is Windows XP, Visual Studio .NET 2003 and C#.
So here it goes. I have been able to set up async sockets that listen to a particulare port with Bind and Listen and accept connections with Socket.BeginAcc ept and Socket.EndAccep t. The class also listens with the Socket.BeginRec eive and Socket.EndRecei ve functions. I also use the ManualResetEven t to signal finished states between the various async functions. I am using a custom developed collection class to hold connected sockets that are retreived on the call to Socket.EndConne ct in the SocketConnectCa llback function. I understand how to do all this. Where my failure of understanding comes in, is when I want to send data. I want to send data from the same socket that I am listening on. So let's say I have a class that controls the starting and stopping of a listening socket. This class also has a custom developed class that is a collection of sockets stored by the hash of the RemoteEndPoint that it is connected to. I first check to see if the collection contains a current connection to the endpoint that I want to send data to. If it does, grab that socket which is already connected and do a BeginSend on it with the data I want to send. Here is where I get confused. If a socket with the endpoint that I want to send data to does not exist, I want to connect to a remote system using the port of the socket that I am currently listening on. Either using the blocking Connect or the async BeginConnect, preferably the later. When I attempt to do this I get a System.SystemEx ception {"An invalid argument was supplied"}. Now if I create a new socket with the same AddressFamily, etc and do a BeginConnect, it picks up a new port and connects to the remote system and then I can send data on that socket. I understand that this is an option but not the option that I want.
What am I overlooking or misunderstandin g here? The reason why I want to connect from a specific port is because I am writing a P2P app that tracks all clients by a given address and port. If my approach is not valid I am going to have to drop back, punt and rethink.... :).
Thanks for any/all help that you may be able to provide.

John

Nov 16 '05 #2
Harris,
Thank you for your response. Your answer makes sense to me.
As to your not understanding maybe I can clear that up. I'll try to be concise but I can't promise brief. :) In the P2P application that I am writing the architecture is designed so that I will have connections to four clients at any one time. Whether that connection was initiated by the client when joining the P2P network, reshuffling connections and being reconnected to a better bandwidth matching peer and other types of operations, or the peer that is listening is connecting to a remote peer based upon protocol traffic received by one of its currently connected peers such as a BroadcastJoinNe tworkPacket. For example, when a server, which in the current architecture is also a client to other peers, receives a BroadcastJoinNe tworkPacket via currently connected peers on behalf of a peer requesting to join, it will look at certain information about the peer that attempting to join. Things such as the bandwidth, IP address and the number and make up of the peers it has currently connected and then make a determination on whether it would be a good peer neighbor for the peer that is requesting to join. If the receiving peer determines it would be a good neighbor it will make a connection to the requesting peer and send the appropriate response to it. The point of my confusion is that in all the packets that are sent there is included what I call the "header" for the packet. Such things as the length of the packet being sent, the IPEndPoint bytes that the peer sending the packet is listening on, a UniqueID for the peer and the checksum of the message being sent in the payload of the packet. This is sent regardless of the type of packet that is being transmitted. I wanted to track each peer by the hash code of the socket's RemoteEndPoint that is retrieved after a call EndConnect and wanted to short circuit having to include bytes for an IPEndPoint in the header of the packet that the remote peer is listening on. I wanted to be able to track each client by that RemoteEndPoint. What this would mean is that if that client peer wanted to connect multiple times to the same remote peer, I could track it uniquely by that one RemoteEndPoint. What your answer means to me in this situation is that I will have to track each packet uniquely by the IPEndPoint.Seri alize().GetByte s data that is in the packet header instead of using the RemoteEndPoint of the peer that is connecting. I won't be able to categorize how to route that data to the appropriate handler classes so that I can control such things as the amount of data/second that can be sent/received to a particular peer, until after at least the header information is retrieved for a given packet.
You know, the more I am talking about this architecture the more that I am starting to see that maybe I don't have things as well thought out as I originally thought I did. Time to go back to my interaction model and make sure it is right before I try to provide the solution for it. I'm 85% of the way there on both architecture and the interaction model but I feel that I have missed something, but I am getting there. It's like peeling back the layers of an onion. The more layers that you dig, the more questions you have. The more questions you answer, the better that you are able to understand the questions you should be asking next.

Thanks again, and be looking for a new secure, anonymous and completely distributed C# based P2P application to go into beta within the year. I am shooting for October but it may be sooner. I am also trying to write it so that it will run on MONO as well. Looks like I will be pushing MONO's Windows.Forms implementation to it breaking point as I go along. Fun, fun.. FYI the complete P2P network functionality will be rolled into a dll that can then be utilized by whatever GUI that is necessary. Thanks for letting me bend your ear. :)

John
"Harris Reynolds" wrote:
John,

If I understand you correctly I don't think what you want to do is possible. The socket that is listening on a particular port can only connect and communicate with a client when the client initiates the connection. After a connection is established then either the server or client can send and receive data via the socket. However, it is not possible to connect to a remote computer using the same socket that you are listening on. That isn't a limitation of .Net or C#; it's just the way sockets work.

I'm still a little curious why the port would need to be the same on the server when it wants to initiate sending data to a remote computer that has not previously made a connection. Why is that a hard requirement?

good luck... hope this helps some,

~harris

"John Sheppard" wrote:
Hi all,
I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic.
My programming environment is Windows XP, Visual Studio .NET 2003 and C#.
So here it goes. I have been able to set up async sockets that listen to a particulare port with Bind and Listen and accept connections with Socket.BeginAcc ept and Socket.EndAccep t. The class also listens with the Socket.BeginRec eive and Socket.EndRecei ve functions. I also use the ManualResetEven t to signal finished states between the various async functions. I am using a custom developed collection class to hold connected sockets that are retreived on the call to Socket.EndConne ct in the SocketConnectCa llback function. I understand how to do all this. Where my failure of understanding comes in, is when I want to send data. I want to send data from the same socket that I am listening on. So let's say I have a class that controls the starting and stopping of a listening socket. This class also has a custom developed class that is a collection of sockets stored by the hash of the RemoteEndPoint that it is connected to. I first check to see if the collection contains a current connection to the endpoint that I want to send data to. If it does, grab that socket which is already connected and do a BeginSend on it with the data I want to send. Here is where I get confused. If a socket with the endpoint that I want to send data to does not exist, I want to connect to a remote system using the port of the socket that I am currently listening on. Either using the blocking Connect or the async BeginConnect, preferably the later. When I attempt to do this I get a System.SystemEx ception {"An invalid argument was supplied"}. Now if I create a new socket with the same AddressFamily, etc and do a BeginConnect, it picks up a new port and connects to the remote system and then I can send data on that socket. I understand that this is an option but not the option that I want.
What am I overlooking or misunderstandin g here? The reason why I want to connect from a specific port is because I am writing a P2P app that tracks all clients by a given address and port. If my approach is not valid I am going to have to drop back, punt and rethink.... :).
Thanks for any/all help that you may be able to provide.

John

Nov 16 '05 #3
Harris,
Thank you for your response. Your answer makes sense to me.
As to your not understanding maybe I can clear that up. I'll try to be concise but I can't promise brief. :) In the P2P application that I am writing the architecture is designed so that I will have connections to four clients at any one time. Whether that connection was initiated by the client when joining the P2P network, reshuffling connections and being reconnected to a better bandwidth matching peer and other types of operations, or the peer that is listening is connecting to a remote peer based upon protocol traffic received by one of its currently connected peers such as a BroadcastJoinNe tworkPacket. For example, when a server, which in the current architecture is also a client to other peers, receives a BroadcastJoinNe tworkPacket via currently connected peers on behalf of a peer requesting to join, it will look at certain information about the peer that attempting to join. Things such as the bandwidth, IP address and the number and make up of the peers it has currently connected and then make a determination on whether it would be a good peer neighbor for the peer that is requesting to join. If the receiving peer determines it would be a good neighbor it will make a connection to the requesting peer and send the appropriate response to it. The point of my confusion is that in all the packets that are sent there is included what I call the "header" for the packet. Such things as the length of the packet being sent, the IPEndPoint bytes that the peer sending the packet is listening on, a UniqueID for the peer and the checksum of the message being sent in the payload of the packet. This is sent regardless of the type of packet that is being transmitted. I wanted to track each peer by the hash code of the socket's RemoteEndPoint that is retrieved after a call EndConnect and wanted to short circuit having to include bytes for an IPEndPoint in the header of the packet that the remote peer is listening on. I wanted to be able to track each client by that RemoteEndPoint. What this would mean is that if that client peer wanted to connect multiple times to the same remote peer, I could track it uniquely by that one RemoteEndPoint. What your answer means to me in this situation is that I will have to track each packet uniquely by the IPEndPoint.Seri alize().GetByte s data that is in the packet header instead of using the RemoteEndPoint of the peer that is connecting. I won't be able to categorize how to route that data to the appropriate handler classes so that I can control such things as the amount of data/second that can be sent/received to a particular peer, until after at least the header information is retrieved for a given packet.
You know, the more I am talking about this architecture the more that I am starting to see that maybe I don't have things as well thought out as I originally thought I did. Time to go back to my interaction model and make sure it is right before I try to provide the solution for it. I'm 85% of the way there on both architecture and the interaction model but I feel that I have missed something, but I am getting there. It's like peeling back the layers of an onion. The more layers that you dig, the more questions you have. The more questions you answer, the better that you are able to understand the questions you should be asking next.

Thanks again, and be looking for a new secure, anonymous and completely distributed C# based P2P application to go into beta within the year. I am shooting for October but it may be sooner. I am also trying to write it so that it will run on MONO as well. Looks like I will be pushing MONO's Windows.Forms implementation to it breaking point as I go along. Fun, fun.. FYI the complete P2P network functionality will be rolled into a dll that can then be utilized by whatever GUI that is necessary. Thanks for letting me bend your ear. :)

John
"Harris Reynolds" wrote:
John,

If I understand you correctly I don't think what you want to do is possible. The socket that is listening on a particular port can only connect and communicate with a client when the client initiates the connection. After a connection is established then either the server or client can send and receive data via the socket. However, it is not possible to connect to a remote computer using the same socket that you are listening on. That isn't a limitation of .Net or C#; it's just the way sockets work.

I'm still a little curious why the port would need to be the same on the server when it wants to initiate sending data to a remote computer that has not previously made a connection. Why is that a hard requirement?

good luck... hope this helps some,

~harris

"John Sheppard" wrote:
Hi all,
I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic.
My programming environment is Windows XP, Visual Studio .NET 2003 and C#.
So here it goes. I have been able to set up async sockets that listen to a particulare port with Bind and Listen and accept connections with Socket.BeginAcc ept and Socket.EndAccep t. The class also listens with the Socket.BeginRec eive and Socket.EndRecei ve functions. I also use the ManualResetEven t to signal finished states between the various async functions. I am using a custom developed collection class to hold connected sockets that are retreived on the call to Socket.EndConne ct in the SocketConnectCa llback function. I understand how to do all this. Where my failure of understanding comes in, is when I want to send data. I want to send data from the same socket that I am listening on. So let's say I have a class that controls the starting and stopping of a listening socket. This class also has a custom developed class that is a collection of sockets stored by the hash of the RemoteEndPoint that it is connected to. I first check to see if the collection contains a current connection to the endpoint that I want to send data to. If it does, grab that socket which is already connected and do a BeginSend on it with the data I want to send. Here is where I get confused. If a socket with the endpoint that I want to send data to does not exist, I want to connect to a remote system using the port of the socket that I am currently listening on. Either using the blocking Connect or the async BeginConnect, preferably the later. When I attempt to do this I get a System.SystemEx ception {"An invalid argument was supplied"}. Now if I create a new socket with the same AddressFamily, etc and do a BeginConnect, it picks up a new port and connects to the remote system and then I can send data on that socket. I understand that this is an option but not the option that I want.
What am I overlooking or misunderstandin g here? The reason why I want to connect from a specific port is because I am writing a P2P app that tracks all clients by a given address and port. If my approach is not valid I am going to have to drop back, punt and rethink.... :).
Thanks for any/all help that you may be able to provide.

John

Nov 16 '05 #4
Harris,
Thank you for your response. Your answer makes sense to me.
As to your not understanding maybe I can clear that up. I'll try to be concise but I can't promise brief. :) In the P2P application that I am writing the architecture is designed so that I will have connections to four clients at any one time. Whether that connection was initiated by the client when joining the P2P network, reshuffling connections and being reconnected to a better bandwidth matching peer and other types of operations, or the peer that is listening is connecting to a remote peer based upon protocol traffic received by one of its currently connected peers such as a BroadcastJoinNe tworkPacket. For example, when a server, which in the current architecture is also a client to other peers, receives a BroadcastJoinNe tworkPacket via currently connected peers on behalf of a peer requesting to join, it will look at certain information about the peer that attempting to join. Things such as the bandwidth, IP address and the number and make up of the peers it has currently connected and then make a determination on whether it would be a good peer neighbor for the peer that is requesting to join. If the receiving peer determines it would be a good neighbor it will make a connection to the requesting peer and send the appropriate response to it. The point of my confusion is that in all the packets that are sent there is included what I call the "header" for the packet. Such things as the length of the packet being sent, the IPEndPoint bytes that the peer sending the packet is listening on, a UniqueID for the peer and the checksum of the message being sent in the payload of the packet. This is sent regardless of the type of packet that is being transmitted. I wanted to track each peer by the hash code of the socket's RemoteEndPoint that is retrieved after a call EndConnect and wanted to short circuit having to include bytes for an IPEndPoint in the header of the packet that the remote peer is listening on. I wanted to be able to track each client by that RemoteEndPoint. What this would mean is that if that client peer wanted to connect multiple times to the same remote peer, I could track it uniquely by that one RemoteEndPoint. What your answer means to me in this situation is that I will have to track each packet uniquely by the IPEndPoint.Seri alize().GetByte s data that is in the packet header instead of using the RemoteEndPoint of the peer that is connecting. I won't be able to categorize how to route that data to the appropriate handler classes so that I can control such things as the amount of data/second that can be sent/received to a particular peer, until after at least the header information is retrieved for a given packet.
You know, the more I am talking about this architecture the more that I am starting to see that maybe I don't have things as well thought out as I originally thought I did. Time to go back to my interaction model and make sure it is right before I try to provide the solution for it. I'm 85% of the way there on both architecture and the interaction model but I feel that I have missed something, but I am getting there. It's like peeling back the layers of an onion. The more layers that you dig, the more questions you have. The more questions you answer, the better that you are able to understand the questions you should be asking next.

Thanks again, and be looking for a new secure, anonymous and completely distributed C# based P2P application to go into beta within the year. I am shooting for October but it may be sooner. I am also trying to write it so that it will run on MONO as well. Looks like I will be pushing MONO's Windows.Forms implementation to it breaking point as I go along. Fun, fun.. FYI the complete P2P network functionality will be rolled into a dll that can then be utilized by whatever GUI that is necessary. Thanks for letting me bend your ear. :)

John
"Harris Reynolds" wrote:
John,

If I understand you correctly I don't think what you want to do is possible. The socket that is listening on a particular port can only connect and communicate with a client when the client initiates the connection. After a connection is established then either the server or client can send and receive data via the socket. However, it is not possible to connect to a remote computer using the same socket that you are listening on. That isn't a limitation of .Net or C#; it's just the way sockets work.

I'm still a little curious why the port would need to be the same on the server when it wants to initiate sending data to a remote computer that has not previously made a connection. Why is that a hard requirement?

good luck... hope this helps some,

~harris

"John Sheppard" wrote:
Hi all,
I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic.
My programming environment is Windows XP, Visual Studio .NET 2003 and C#.
So here it goes. I have been able to set up async sockets that listen to a particulare port with Bind and Listen and accept connections with Socket.BeginAcc ept and Socket.EndAccep t. The class also listens with the Socket.BeginRec eive and Socket.EndRecei ve functions. I also use the ManualResetEven t to signal finished states between the various async functions. I am using a custom developed collection class to hold connected sockets that are retreived on the call to Socket.EndConne ct in the SocketConnectCa llback function. I understand how to do all this. Where my failure of understanding comes in, is when I want to send data. I want to send data from the same socket that I am listening on. So let's say I have a class that controls the starting and stopping of a listening socket. This class also has a custom developed class that is a collection of sockets stored by the hash of the RemoteEndPoint that it is connected to. I first check to see if the collection contains a current connection to the endpoint that I want to send data to. If it does, grab that socket which is already connected and do a BeginSend on it with the data I want to send. Here is where I get confused. If a socket with the endpoint that I want to send data to does not exist, I want to connect to a remote system using the port of the socket that I am currently listening on. Either using the blocking Connect or the async BeginConnect, preferably the later. When I attempt to do this I get a System.SystemEx ception {"An invalid argument was supplied"}. Now if I create a new socket with the same AddressFamily, etc and do a BeginConnect, it picks up a new port and connects to the remote system and then I can send data on that socket. I understand that this is an option but not the option that I want.
What am I overlooking or misunderstandin g here? The reason why I want to connect from a specific port is because I am writing a P2P app that tracks all clients by a given address and port. If my approach is not valid I am going to have to drop back, punt and rethink.... :).
Thanks for any/all help that you may be able to provide.

John

Nov 16 '05 #5
Harris,
Thank you for your response. Your answer makes sense to me.
As to your not understanding maybe I can clear that up. I'll try to be concise but I can't promise brief. :) In the P2P application that I am writing the architecture is designed so that I will have connections to four clients at any one time. Whether that connection was initiated by the client when joining the P2P network, reshuffling connections and being reconnected to a better bandwidth matching peer and other types of operations, or the peer that is listening is connecting to a remote peer based upon protocol traffic received by one of its currently connected peers such as a BroadcastJoinNe tworkPacket. For example, when a server, which in the current architecture is also a client to other peers, receives a BroadcastJoinNe tworkPacket via currently connected peers on behalf of a peer requesting to join, it will look at certain information about the peer that attempting to join. Things such as the bandwidth, IP address and the number and make up of the peers it has currently connected and then make a determination on whether it would be a good peer neighbor for the peer that is requesting to join. If the receiving peer determines it would be a good neighbor it will make a connection to the requesting peer and send the appropriate response to it. The point of my confusion is that in all the packets that are sent there is included what I call the "header" for the packet. Such things as the length of the packet being sent, the IPEndPoint bytes that the peer sending the packet is listening on, a UniqueID for the peer and the checksum of the message being sent in the payload of the packet. This is sent regardless of the type of packet that is being transmitted. I wanted to track each peer by the hash code of the socket's RemoteEndPoint that is retrieved after a call EndConnect and wanted to short circuit having to include bytes for an IPEndPoint in the header of the packet that the remote peer is listening on. I wanted to be able to track each client by that RemoteEndPoint. What this would mean is that if that client peer wanted to connect multiple times to the same remote peer, I could track it uniquely by that one RemoteEndPoint. What your answer means to me in this situation is that I will have to track each packet uniquely by the IPEndPoint.Seri alize().GetByte s data that is in the packet header instead of using the RemoteEndPoint of the peer that is connecting. I won't be able to categorize how to route that data to the appropriate handler classes so that I can control such things as the amount of data/second that can be sent/received to a particular peer, until after at least the header information is retrieved for a given packet.
You know, the more I am talking about this architecture the more that I am starting to see that maybe I don't have things as well thought out as I originally thought I did. Time to go back to my interaction model and make sure it is right before I try to provide the solution for it. I'm 85% of the way there on both architecture and the interaction model but I feel that I have missed something, but I am getting there. It's like peeling back the layers of an onion. The more layers that you dig, the more questions you have. The more questions you answer, the better that you are able to understand the questions you should be asking next.

Thanks again, and be looking for a new secure, anonymous and completely distributed C# based P2P application to go into beta within the year. I am shooting for October but it may be sooner. I am also trying to write it so that it will run on MONO as well. Looks like I will be pushing MONO's Windows.Forms implementation to it breaking point as I go along. Fun, fun.. FYI the complete P2P network functionality will be rolled into a dll that can then be utilized by whatever GUI that is necessary. Thanks for letting me bend your ear. :)

John

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3076
by: Rolln_Thndr | last post by:
I'm vey new to network programing and have a few rather fundemental questions. I'm creating a very basic UDP proxy server and having a few issues regarding the sockets. Is it possible to change the properties of a socket WITHOUT closing it and creating a new one? Basically, I need to change the port of a bound socket, but the only way I have found to do this so far is to close the exisitng socket and create a new one. This in itself...
1
2933
by: Andrew Arace | last post by:
Hi, I'm wondering what the industry practices are for socket and internet programming. Can you provide any links to good articles on network application architecture? I have found many tutorials, but most don't get into the detail I desire, and are very very simple TCPClient/TCPListener implementations. I haven't found any great literature on how production-level data transmisison applications are made. For example, suppose I'm making...
4
6315
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
4
4863
by: seets375 | last post by:
Hi, I have two ethernet interfaces on my system, with IPs assigned to the interfaces from different subnets (e.g. eth1 - 10.10.10.10 and eth2 - 20.20.20.20 ). I'm connecting these interfaces to a home gateway or router. The 'eth1' interface connects to LAN interface of the router with IP address 10.10.10.1 and the 'eth2' interface connects to WAN interface of the router with IP address 20.20.20.1. I'm trying a simple socket program...
4
1196
by: Ravikumar | last post by:
Hi All, The following code snippet is a part of s/w which is downloaded from net. While compiling this code I got the following error. ...\..\snmplib\snmpTCPDomain.c(6) : fatal error C1083: Cannot open include file: 'sys/socket.h': No such file or directory NMAKE : fatal error U1077: 'cl.exe' : return code '0x2' Stop. NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~3\VC98\BIN\NMAKE.EXE' :
2
2706
by: Sandy | last post by:
Hi All, I'm a newbe to socket programming, I need to work on a project that has to be developed in C++ or Visual C++ ( I have 8.0 version) console application. which will be execute from a Java GUI application using dos command and pass a userid, password and a port number( to connect back to Java GUI using TCPprovided ) using the user and password information I need to connect to a vendor using there API and get the information from the...
9
20624
by: Hao | last post by:
We are doing very intensive network communication. We collect data from thousands of electric devices every minutes. The devices understand both socket and web service. They are either embeded linux based system or Windows based servers. WCF, as I understand, has overhead vs. native socket ..Net programming. Should I continue to use socket programming or look into the new WCF model? Thanks. Hao
8
4672
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In page_load event, I am using atl com component. Here one for loop is there. In this for loop, number of iterations are 1000, I can receive some data using com component. It is just set of some characters like
6
3663
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both windows and linux. so I guess there is a problem with makefile(). # Echo server program
0
8538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9083
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8797
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6459
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5818
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2237
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1957
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.