Link to home
Start Free TrialLog in
Avatar of encryptedhearts
encryptedhearts

asked on

Socket programming(TCP) in VB.net without make connections

Hi Guys,
      I want to communicate between  2 systems using Socket class in VB.net. Protocol type :TCP . Without making a connection how can i send data to another system? I tried using "SendTo()" method. but it throws error

"A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied" during runtime .

But  In the MSDN Document they said,
"Although intended for connectionless protocols, SendTo also works with connection-oriented protocols. If you are using a connection-oriented protocol, you must first establish a remote host connection by calling the Connect method or accept an incoming connection request using the Accept method. If you do not establish or accept a remote host connection, SendTo will throw a SocketException. You can also establish a default remote host for a connectionless protocol prior to calling the SendTo method. In either of these cases, SendTo will ignore the remoteEP parameter and only send data to the connected or default remote host."

please help me

Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of cookre
cookre
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Note that UDP does not guarantee delivery of the packet.  If delivery is mandatory, the recipients must have knowledge of session content.  This can be implemented by including a 'this is part 17 of 236' indicator in each transmission and providing a call-back port for recipients to request resends.
Avatar of encryptedhearts
encryptedhearts

ASKER

Normally In VB or Java For TCP Socket no need to make any connections before transmission of data but in VB.net that method is not working. We have to make connection for data transmission. How to overcome this problem?
Are you trying to use the Winsock control or are you using classes in the System.Net.Sockets namespace?
i'm using System.Net.Sockets Namespace
y u did not wan to make to connection ?
coz my client having server, our part is to develop only client side program. they didnt tell any more details, they juz said they r using tcp for connections.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How's it going?