Info: Multithreaded Server Socket Program Or Client/Server?

Oct 26, 2011

I made a simple TCP server (I've found the example on the web) in VB to receive data from about 40 TCP clients.The clients are not synchronized but sends data about every 18 minutes; the problem is sometimes several clients sends data at the same moment, so I can't receive data.I also made a second program that reads the data (server program writes data on a file, read from the second program) scheduled.

My question is this: I've seen on the web examples about Multithreaded Server Socket Program, so I suppose this could manage my 40 clients (but now the clients are syncronized and send data at the same time in client mode) or is better get data (I have a central client that asks data to all 40 devices in server mode)?

Second question: can I make a single program where I run both TCP client and TCP server at the same time?

View 1 Replies


ADVERTISEMENT

Specific Cast Is Not Valid In Client Server Socket Program

Jun 14, 2012

I am Working on Teghax Component.Using This Component we want to find out Block title attribute of dwg file in a client server socket application.

1> We get Block title attributes properly of dwg file in windows application form using the getattribute function().

2> We get Block title Attributes properly in that way:-We take a class library where we take a class.in this class we use getattribute function().Then We access the particular class from another project

But when we use the same class(Keep same structure) in client server socket program.Then it gives an exception.i.e ,"Spaicfied cast is not valid"I am Not getting any reply form teghax developer..I attached exception screen sort.Give me Suggestion How to solve this Exception

Code given Bellow :

Public Function Get_DwgFileAttribute(ByVal Sender As ClsTcpConnection, ByVal msgTag As Byte, ByVal message As String) As String
Dictionary = GetHashtable(message)
Dim varfilepath As String = CStr(Dictionary.Item("filePath"))

[code]....

View 1 Replies

VS 2005 MultiThreaded Server Socket: From Console To Windows Applications?

Nov 23, 2011

I would like to make a multi-socket TCP server (to accept multiple clients at the same time).I'm working with Visual Studio 2005 Express, maybe that's why files on CodeBank don't work..I found on the web an example about MultiThreaded Server Socket programming, but this is done for "Console application" in this way:

[Code]...

View 7 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

Communications :: Client-server Communication Program - Click On CmdListen In The Server Form And CmdConnect In The Client Form

Jul 23, 2008

The problem I have is: When I click on cmdListen in the server form and cmdConnect in the client form,both programs won't respond and they crash for some reason I don't know.

Client source code:

Code:

Imports System.Net.Sockets
Imports System.Text
Public Class Form1

[CODE]...

Code:
Imports System.Net.Sockets
Imports System.Text
Public Class Form1

[CODE]...

View 3 Replies

Client Server Winsock Or Socket Programming?

Jul 14, 2009

how to access client side activity i.e. which client is connected and which computer connected at the same time from server.

View 1 Replies

.net - Check The Connection State Of A TCP Server (Socket) With TCP Client?

Apr 23, 2012

For almost a week I am reading and trying to find a solution for checking connection state using a TCP Client (using socket class) In my scenario I have a TCP Client that is connected to a server (it is not controlled by me) and i want that from time to time to check the connection state, and reconnect if necessary.I have read a lot of information on the internet but i did not find a suitable solution.Briefly, these are the methods that i have found on the internet and try to implement.But unfortunatelly, i have found some scenarios where the TCP Server is closed and the TCP Client is still saying Connected 1.Example from MSDN

[code]...

View 1 Replies

Get The Client Connection Parameters Of The Socket On Server Side?

Sep 13, 2011

I want both the client and server to write and read resp. at a constant rate (which can be configured on the GUI of the client) to the buffer.I am able to send from the client at 150 bytes per packet Now, I should be able to read also at 150 bytes per packet on the server too Since, both are connected through a socket, can we retrieve the socket params (set on the client size, like 150 here) from the server end, using the tcpServer object.Or is it must to send an initial setup packet which tells about these client params and so accordingly the server can continue?

View 1 Replies

TCP Client Error While Reading Data From Socket Server?

Apr 20, 2012

I have a TCP Socket Client (using the Socket Class) that is connected to a simple TCP socket server (just for testing)I have this code snippet :

Dim aSocket as Socket
While aSocket.Connected = True
byteRead = aSocket.Receive(dataByte) 'number of bytes

[code].....

View 1 Replies

VS 2008 Multi-User Chat Program (Server & Client) With Main Server?

Aug 10, 2009

Multi-User Chat Program (Server & Client) with Main Server?

View 1 Replies

VS 2010 TCP Chat Server Closes Socket On Client DisConnect?

Jun 24, 2010

I am working on a chat client and server, and so far it works well, but when I close the client, the server throws an exception because it continues to try to do processes on the disconnected client. I have tried adding clientSocket.Close() in various places throughout the client and server with no luck. Does someone know how to add the disconnect code to either the server or client with this code?Server:

Imports System.Net.Sockets
Imports System.Text
Module Module1

[code].....

View 5 Replies

Asynchronous Socket Programming Vb 2008(.net) Again Server Should Able To Send The Data To Client

Feb 2, 2011

I am facing problem in asynchronous socket communication.

1)I wanted to perform connect(from client to server) operation on enter button and send the data whatever client want to send and disconnect from server. And again client should get connect to server whenever client wanted to send data. this is the mechanism.

i.e how to reuse the socket.

2)Again Server should able to send the data to client.

View 5 Replies

VS 2008 TCP Server / Client - Client To Send The Server 4 Numbers - Depending On The User's Choice

May 9, 2009

how to create a client/server... But I couldn't... I don't want anything fancy. Just want the client to send the server 4 numbers, depending on the user's choice; after that, the server would turn off the pc, restart it, etc. It all depends on the number received. Is there a rather "simple" way to do it? If it's not to much trouble you could use Atheist's example. (Btw I don't understand the code and, yes, I've checked on [URL])

View 9 Replies

VS 2010 : Send Data From Client To Server (encrypted) And The String Sent From The Client Is Not The Same As Received From The Server?

Jun 27, 2011

Hey guys, I am trying to send data from client to server (encrypted) and the string sent from the client is not the same as recieved from the server. I've been killing my brain for hours to get this to work but I cant manage. Im converting everything to Base64 string.

Client:

Public Sub SendMessage(ByVal msg As String)
Try
SyncLock myclient.GetStream
sw = New IO.StreamWriter(myclient.GetStream)

[code]....

View 4 Replies

Writing A Program With 1 Client And Server Where Client Side Creates A Text File

Dec 1, 2008

I have been reading through Atheists posts in regards to client-server and TCP client/server connection's. But how do i go about writing a program with 1 client and server where the client side creates a text file.Once the server sees there is a text file it connects and downloads it to itself or the client pushes the text file to the server.Once on the server i will read the text file and put its info into a sql db.

View 14 Replies

Communicate From Client To Server From Multiple Clients On Multiple Requests In Socket Programming?

Jan 8, 2010

I have been struggling to find a solution for this problem. What I need to do is build a server application that accepts tcp client requests from different clients running on same port say:1003. I experimented by using asynchronous mode call backs etc. but it disconnects once connection is established and does not respond for further requests from the same client.

View 1 Replies

Create Client-server App, In Which Client Can View Files On Server?

Nov 15, 2011

basically i just want client to say "C: emp" ENTER

then, server must reply with all its files in c: emp

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

Server And Client Tcp/ip Program?

Jan 2, 2010

I have been working on a server and client tcp/ip program and am having some issues. I start the server and then start the client, and the connection always fails. I don't know what's going wrong. Here's the

Server:
Imports System.Net
Imports System.Net.Sockets
Imports System.IO

[Code]...

View 2 Replies

Server/Client - Basic Tcp Server/client Application

Mar 30, 2009

I've basically made a basic tcp server/client application. The thing is that I'm behind a router and so will be the other people that use my clients. I've had to use port-forwarding or the software "rinetd"to run quite a few applications online.

Let me explain: I'm on a lan network that connects to the internet. Whenever I want to host a server - for instance a basic ftp or http server. If I give my external IP to anyone, they won't be able to access my server. Even if I portforward, it doesnt work. I have to use rinetd here. For other applications, portforwarding works. I'm not sure how these things work at all.

Anyway, my issue now is that I have created this server/client application. I'm having serious doubts that if I run the server, I'll have to either a) portforward or use rinetd to get people to connect to my server. IF I need to portforward, that's fine. However, using rinetd would really suck... My 2nd concern is as follows: IF the person running the client is in a similar situation as me (i.e he's on a lan that has a router which connects to the net), will he have to portforward or use rinetd as well? If he portforwards that's fine. But I don't think I could get people to use rinetd.... Also, if there are more than 1 person on a lan trying to connect to my server, there is a big problem when they try to portforward: they will only be able to allocate one of their internal ip to that port, and the others won't be able to connect, right? How does this work? I mean, I use many softwares like msn/skype/(some games)/firefox that do not need portforwarding/rinetd. Yet they work. My housemates(other people on the lan) use the same softwares, and it works fine. There's no clash/probs watsoever How come these run fine?

Anyway, back to my issues. Given I have no knowledge about how the above work, I was wondering whether there was a way to host a vb .net server application on an external website (external to my house) so that I might *avoid* the above mentioned problems, and to what extent that would be a sound solution.

View 11 Replies

Update Server Program When Client Program Added Record To Database?

Aug 18, 2010

I am creating a very simple Voting System, that will be use on electing new set of officer in a teacher cooperative...

So I have to create two separate program, a Server Program that will manage all the information in the election and a Client Program where voters will vote their selected candidate...

The election officers wanted that the Server Program will display the Voting Results at real time... So when the Voter finished voting, The Voting Result displayed by the Server Program will also be updated every time the Client Program Insert the data to Database....

An action listener in Server Program that will execute if new data is inserted in a Table in the Database made by the Client Program...

View 11 Replies

Client Server Program Without Winsock?

Apr 16, 2011

how can i make claint/server program without winsocet

View 1 Replies

Create A Server And Client Program

Oct 17, 2011

I have been a web developer for a number of years now and I am making the move over to form based applications. I am trying to do what I believe should be relatively simple, yet I have no idea where to start.At home I have a machine that family members tend to use P2P programs, which causes my online gaming to suffer with glitches.I want to create a server and client program.where the client app (on my laptop) consists of only one button, when the button is pressed I want the server app (my Desktop) to kill the P2P program.I already know how to kill/start the application in question.I have previously done something similar but I had used winsock (not in VS2010) and was a long time ago.

1) Sending a value/string from the client app

2) receiving the value/string on the server app

I was told to look into the system.net.sockets namespace, but I haven't found anything on the web or here that isn't a full project / over-engineered "Basic Tutorial" that helps to break this down

View 5 Replies

Create A Server And Client Program?

Mar 20, 2009

I Want To Create A Server Program On My Computer AndClient Program That Can Run On Other Computers, The Client Program Will Connect To The Server On My Computer, But I Don't Know Code To Do This.

View 1 Replies

Create Server/Client Program In .NET?

May 7, 2009

I am trying to create a server/client program in vb.net. What I am trying to do is test a battery that is running on a handheld (which runs Windows CE 5) by connecting to a "server" and sending information every 10 seconds or so. I am very new to .NET, and am not really sure how to go about doing this. I want two separate applications running, with the server-side keeping all of the data, since the battery is going to die, and I will lose any information if I keep it client-side. I am also new to networking, so I was not sure of whether I should create a Socket, or if I should try to do something else.

View 1 Replies

Clinet/server The Server Broadcast Media Files To Client I Used Tcp/ip Protocol?

May 13, 2011

i have 2 application clinet/server the server broadcast media files to client i used tcp/ip protocol the server code is work good but i have a problem in client code i need ineed someone to correct the code .iwll show where the error is in the code note: i call the class in the main form dim a as recive in the starter of the main form class to be gloable .

[Code]...

View 4 Replies

SQL Server 2008 Configuration For Client Server (Windows Form) Application

Apr 6, 2012

Case : I'm creating an application (desktop application) with VB.NET (actually windows form), and using SQL Server Express 2008 for its database.

[Code]...

View 1 Replies

The SMTP Server Requires A Secure Connection Or The Client Was Not Authenticated. The Server Response Was 5.5.1 Authentication Required

Nov 28, 2009

This emailing code wont seem to work in my program. I get an exception "The SMTP server requires a secure connection or the client was not authenticated. The server response was 5.5.1 authentication required."

Imports System.Net.Mail
Public Class emailStudent
Private Sub sendEmailButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sendEmailButton.Click
SendMail()

[code]....

View 12 Replies

Difference Between SQL Server Native Client And SQL Server DSN To Support SP Execution?

Jul 9, 2009

I wrote a VB code to call a sp in sql server 2005, which returns a recordset as follows:Dim objRecordset As ADODB.Recordset Set objComm = New ADODB.Command

Set objRecordset = objComm.Execute If Not objRecordset.BOF And Not objRecordset.EOF Then
Set objRecordset = objRecordset.NextRecordset I need to continue to get next recordset since there are many select statements inside the sp which I need to get the data. The code works fine when I create the DSN using SQL Server but it does not work when using the connection string or SQL Server Native Client DSN. It either breaks at Set objRecordset = objComm.Execute ( connection string )or at If Not objRecordset.BOF And Not objRecordset.EOF Then(SQL native client )

I have worked on this for a couple of days now and could not figure it out.Is this a bug in SQL Native Client or something related to some configuration on the database side? IS there a way I can change the connection property to get this working using SQL native client or connection string?

View 1 Replies

Program That Uses Sockets To Connect Server To Client

Aug 2, 2010

i made a program that uses sockets to connect the server to client but there is a problem with it when i try it on this ip"127.0.0.1"wich is not a real ip just a loopback to my computer it works just fine when i use my local ip it works as well when i use my main ip from http:whatsmyip.org it doesnt work at all i dont know why it doesnt say an error or an exception but its not connecting so i gave the server to a friend of mine i tried using both his real ip and his local but still not working i dont know why?i mean i am 100% sure of my code...

View 7 Replies







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