System.Net.Sockets.Socket?

Feb 23, 2011

I have a chat program using System.Net.Sockets.Socket that works perfectly over LAN.My question is - will this same program work over the net with little or no modification and if so do i provide the client with the IP of my machine or of my router and use port forwardin

View 1 Replies


ADVERTISEMENT

Event Type Clr20r3 P3 4a5c12c0 System.net.sockets.socket Exception And Application Crash On Some System While Running Well On Others

Aug 3, 2009

Event type clr20r3 p3 4a5c12c0 system.net.sockets.socket Exception and Application crash on some system. while running well on others. i go thorugh many forms and search a lot on google but not able to resolve the issue.

[Code]...

View 1 Replies

System.Net.Sockets.Socket.BeginReceive And StateObject?

Sep 15, 2009

The MSDN Documentation in question can be found here:[URL].. It offers the following code snippet example:

[Code]...

View 2 Replies

Determine If System.Net.Sockets.Socket Has Outgoing Data Not Read?

Sep 18, 2009

Is there a way to determine if a System.Net.Sockets.Socket has sent data that has not been received/read by a specified remote endpoint with a connectionless protocol?It never hurts to try.

View 1 Replies

2005 - Discard The Contents Of A System.Net.Sockets.Socket Send Buffer Using TheSocket.IOControl(IOControlCode.Flush

Jun 10, 2012

I'm attempting to discard the contents of a System.Net.Sockets.Socket send buffer using theSocket.IOControl(IOControlCode.Flush, .... Does anybody know whether VB.NET supports this command? I've tried supplying 'Nothing' and 'Nothing' for both required parameters, also empty and populated byte arrays in combination with 'Nothing' for both required parameters, but I consistently get an 'Invalid argument' exception. I've tried a web search for an answer, but the only mention I've found was a question asked about 8 years ago, with still no answer.

View 1 Replies

VS 2008 Async Socket Connections - Clear Out No Longer Useful Sockets From The Server?

Dec 18, 2009

I have been developing an async socket connection server and client program. I have been testing it, and noticed that if I connect to the server from my client and then disconnect. Upon reconnecting I am on a different port(local IP still). This is fine, however when I go to send a message, and the server trys to update all the clients, it eventually hits clients that do not exist anymore. I get the SocketException 10054, and upon connecting/disconnecting enough, it no longer works at all. My question is how do I clear out these no longer useful sockets from the server? I am doing currentsocket.Shutdown(SocketShutDown.Both); and then a currentsocket.Close(); after that. When a user disconnects.

[Code]...

View 1 Replies

Communications :: Socket Behaviour - Created A Client That Can Send And Receive Data Via TCP Sockets

Aug 26, 2010

I have created a Client that can send and receive data via TCP sockets. The objects stored on the serverside are the *exact* same object used for the client. They use the same send and receive protocols.

Now, when i send a string from the server to the client , it does precisely what it should do. However when I send a string to the server.... I do receive the string as an equal length of NULL characters. I run the server and client locally.

Basicly what can influence the behaviour between two completely identical objects performing the exact same task? I wonder if there is some socketflag issue if the TCPlistener.accept function returns a completely different setup then the one I R used to.

(if it is of any interest, the send protocol is asynchronious)

View 3 Replies

Sockets - Winsock Replacement - Any Decent Public Classes With Events That Wrap The Socket Class?

Jan 25, 2011

I'm trying to update an application from vb6 to vb.net. The orig app used the winsock control. Unfortunately I can't nor do I want to use it in the re-write. Are there any decent public classes with events that wrap the Socket class?

View 1 Replies

System.net.sockets Codes?

Mar 11, 2011

Do you all have any updated websites that provides tutorials about the system.net.sockets namespace?

View 1 Replies

VS 2005 System.Net.Sockets - FTP?

Nov 9, 2009

I'm using System.Net.Sockets namespace for connecting to an ftp server. If a user has to login to a firewall first though, I'm not too sure what to do. The following is what I have working for logging into an ftp server without a firewall. (The Else statement) Do you know what I might add to the if statement? In the method where this conditional is, I am passing a firewall username and password.

m_tcpClient = New TcpClient
' Try to connect to ftp site
' If using firewall, login to it first then issue another command to log in to actual

[code]....

View 6 Replies

.net - 'TcpListener' Is Ambiguous In The Namespace 'System.Net.Sockets'?

Feb 21, 2012

I got 11 errors in my VB program. All the errors look similar: X is ambiguous in the namespace Y

Error line: Imports System.Net.Sockets
Imports System.Text
Module Module1
Sub Main()

Dim serverSocket As New TcpListener(System.Net.IPAddress.Parse("192.168.1.100"), 8888)

View 1 Replies

.net - Retrieving Data After Using System.Net.Sockets SendFile?

Jun 8, 2012

I'm coding a simple TCP client/server in VB.NET to transfer files of all sizes. I decided to use System.Net.Sockets's command SendFile to transfer the bytes through the socket.

On the receiving side, my code to retrieve the bytes works fairly well, but occasionally the transfer randomly stops. I figured out that by putting a small sleep delay between retrieving the next block of data makes the transfers 100% stable.My code to retrieve the data (until there is no data available) is simplified as this:

While newSocket.Available > 0
Threading.Thread.Sleep(100)
newSocket.ReceiveFrom(data, Remote)
End While

I really hate using that sleep delay and figure there must be a proper method/function to retrieve data from SendFile?

View 1 Replies

System.Net.Sockets Namespace - Use For A Chat Client?

May 31, 2009

How would I use this for a chat client? I'm not sure where to even start and the internet is helping me find much about it.

View 4 Replies

Yahoo Login Via System.Net.Sockets Namespace?

Nov 3, 2008

The problem is yahoo changed there login URL Structure. I have placed a peice of the code below.

Dim LoginPacket As String
LoginPacket = "GET http://login.yahoo.com/config?&login=" & txtLEmail.Text & "&passwd=" & strPass.Trim & " HTTP/1.0" & vbCrLf
LoginPacket = LoginPacket & "Accept: */*" & vbCrLf

[code]....

View 11 Replies

VS 2010 IRC Server - Socket System

Aug 3, 2011

i'm creating an IRC server and I already have a few base classes complete like logging and Config. I was about to start with programming the socket class(es) when I realized that I have no idea how to make such a complicated socket system. I do not under any circumstance want to use any other code than my own since that would not help me learn sockets. I am familiar with a single connection socket system like most tutorials use.

[Code]...

View 2 Replies

TCP / IP Chat Program - System Socket Class?

Jul 15, 2009

I wrote a server for a tcp/ip chat program using the system.net.sockets class. When I run the program and the client tries to connect to it, there's an error and it won't work. I am positive that the issue isn't with the client, as I have made a connection with the client before.

Imports System.Net
Imports System.Net.Sockets
Imports System.IO
Public Class Form1
Dim server As New TcpListener(IPAddress.Any, 60)
Dim client As New TcpClient
[Code] .....

View 16 Replies

VS 2008 System.Net.Socket Connection Status?

Dec 8, 2009

im trying to detect if the connection is still active upon trying to send or receive anything. Now I have checks in place if it's connected then it will send or receive however... it's saying it's connected when it is not connected... and therefore my program tries to send and receive and errors.

I am determining if it is ok to send and receive by using the Socket.Poll(-1, SelectMode.SelectWrite)

if it's true then im connected and data can be passed..This seems to always be true until I send something and it fails..How can I catch the socket not being connected before it fails upon sending or receiving?

View 6 Replies

Variables - Created An Application That Communicates Via System.net.socket

Nov 9, 2011

I Have a problem with vb.net. Basically I created an application that communicates via system.net.socket. on the server side of client connect, and a thread checks whether there are new incoming data. if there are data, puts them in a few tread declared variables, together with the "index" of the server. once this is done through "INVOKE" calls a routine that checks the incoming data andperforms an operation based on the data. I'll see what I do not work

Dim returndata As String = System.Text.Encoding.ASCII.GetString(data)

TextBox1.Text = ("DATA : " & returndata & "Socketindex =" & socketindex.ToString & " Index=" & index.ToString)

But that does not appear in the texbox, appears only "returndata", the rest c 'is same thing with the messagebox, individually, can display a messagebox with variable,but when I try to make a messagebox that displays them together, the texbox same thing!

And the same thing if I want to compare them with each other, for example

if index
= 0 then msgbox ("OK")

It does not work ...

View 2 Replies

Exception Found - Cannot Access A Disposed Object. Object Name:'System.Net.Sockets.NetworkStream'

Dec 31, 2009

Occasionally I encountered this exception message while trying to download file from a server using System.Net.FtpWebRequest and System.Net.FtpWebResponse Object.

Download a file.ftpRequest_DL.Method = WebRequestMethods.Ftp.DownloadFile get the response object
Dim ftpResponse_DL As FtpWebResponse = CType(ftpRequest_DL.GetResponse, FtpWebResponse)

[Code]...

View 4 Replies

Identify Connection Lost Between Socket Server And Socket Client?

May 21, 2011

I wrote a Socket Client which will send the Socket Server some data and get some response from Server. This process will be running once in every 2 seconds.

Now what I need to know is How we can identify the connection lost between Server and Client?

I need this to be implemented in the Client side. If there is no connection then Client should automatically close the connection. Once the connection with the server is available in the next attempt it should connect automatically.

View 1 Replies

Client Socket - Send Message Through Client Socket Receive Specified Argument Was Out Of Range Of Valid Values

Oct 15, 2011

Below is my code, but when i send the message thru client socket i receive Specified argument was out of the range of valid values. Parameter name: size

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim serverStream As NetworkStream = clientSocket.GetStream()
Dim outStream As Byte() = _
System.Text.Encoding.ASCII.GetBytes("0800822000000000000004000000000000000920092126012345001")

[CODE]...

View 1 Replies

Reading XML Over Sockets

Feb 17, 2010

I am writing an application which involves reading xml over socket. The messages arrive at socket asynchronously. How can I ensure that data is received in form of complete xml elements, validate received data and which classes will be helpful for me in accomplishing my goal.

View 1 Replies

Using PTP Or NTP Protocol With Sockets?

May 21, 2012

Can i implement PTP (precision time protocol) or NTP (simple network timing) with sockets?

If so, how can i use them to send small packages (4 to 33 bytes) with the smallest delay possible?

P.S. I would prefer to know more about PTP, I've heard that it has smaller delay.

View 1 Replies

.net - Working Of Tcpclient Sockets In .net?

Jun 2, 2011

I have an application in vb.net which will connect with an hardware device and test its functionality. The hardware device basically spits out data continuosly through Ethernet. That is it recieves some data via com ports and spits out the processed data via ethernet.So my application does both. Thats pretty much the entire app.My problem is i am using tcpclient sockets. Now when i connect a tcpclient to the device using

tcpclient.open(ip,port);

Immediately the device sends some data which comes and get stored in the clientsocket. Then i send a command to it ,only then i read the data from the clientsocket using

tcpclient.getstream().read()

at this time the entire data that is the one which flowed immediately when connected to the device and the one that i actually need after passing command is both acquired. This is undesirable. I need the data which i read only after sending the command. So i was wondering if there is any way to clear the tcpclient socket before we do a read. The manual doesnt show any such method.

View 1 Replies

Binding & Connecting Using Sockets?

Sep 29, 2009

Here is an issue with a socket I am having:

Public Sub Connect(ByVal server As String, ByVal port As Integer)
Dim IP As IPAddress = IPAddress.Parse(server)
Dim EP As IPEndPoint = New IPEndPoint(IP, port)

[Code]....

The socket is declared like this, at the top of the code:

Dim sock As Socket

What is wrong here? It says Object reference not set to an instance of an object, which is a NullReferenceException.

View 1 Replies

C# - Sending A String With Sockets?

Aug 20, 2009

I am using Nektra's Deviare to hook winsock's send method calls. My ideia is to learn to also send messages through the same socket than the original application. So what I'm doing is when i detect the first call to send message, I save the socket id(the first argument of the send function), so I can use it later.

So here is my code:

uint socket = 0;
[DllImport("Ws2_32.dll")]
private static extern int send(uint socket, string buf, int len, int flags);

[Code].....

This last messagebox is poping up always -1. Why should be it?

edit: calling WSAGetLastError() returns 2. Which I do not know what it means, as it doesn't seem to appear on msdn.

View 3 Replies

C++ Sending Structs Over Sockets

Aug 25, 2009

i am using vb.net and i would to send some structs to a C++ tcp server.The problem is the structs i am sending might contain other structs.[code]Lets say i want to send FirstStruct over to the C++ Server.

View 2 Replies

Create Sockets And Communicate Over Them?

Mar 4, 2009

I am actually new to VB.net...i have managed to create Sockets and communicate over them..but i dont know how fire sql queries through sockets as they take in Byte data as a input...i want to actually pass queries through sockets and retrive those results...i am using mysql database....i have actually tried changing the connection string (the ip address) for a static network but i think sockets are better for dynamic ip networks.

View 1 Replies

Net.Sockets Wait For Streamwrite?

Nov 25, 2011

Net.Sockets wait for streamwrite?

View 2 Replies

Send Email Using NET Sockets?

Feb 18, 2003

This code will allow you to send Emails using only .NET Sockets. This code was adapted from sample code on[code]...

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved