Hi All, I am looking for a design approach to implement TCP socket server which is going to serve requests based on multiple ports. (1) port1 : dedicated for video streaming (2) port 2: dedicated for audio streaming (3) port 3: dedicated for data streaming. In above scenario do i need to create single server to take care with multiple port request or diff-2 server needs to be created for diff-2 request based on port configuration. Is there any design strategy where connection pool of sockets can be created to serve above mentioned port based requests? i appreciate if any …

Member Avatar
Member Avatar
+0 forum 8

When working with TCP client sockets I often find myself frustrated with the lack of event-driven support. I usually end up writing a whole bunch of code to determine disconnects, reconnecting, etc and I figuired it's time to just write my own class for this stuff. I figuired I'd share it with all of you. The implementation is quite simple, I'll provide an example below. I have XML commented all the public properties and methods, the rest is up to you to figuire out if you want to make any changes! public partial class Form1 : Form { EventDrivenTCPClient client; …

Member Avatar
Member Avatar
+5 forum 16

Hi all. I'm working on a client server application, eventually to be a POS (point of sale) system. The model is something like, client (till) does not have access to the database, instead it sends data to the server application, which in turn deals with the database and any other operations which might need to be carried out. I have my rudimentary client server set up, so far as the server accepts connections from multiple clients. So my next step is dealing with client sending data to the server, and in what fashion etcetera. Say I have a class like …

Member Avatar
Member Avatar
+0 forum 4

I am developing Client-Server application in C++ using Qt framework, but the clients can be android phones and computers(Qt client app) Now i'm having troubles to handle Reception of data on the server side; the server is not receiving data properly. First, I got things working nicely between the server(Qt app) and the client(Qt app) using these methods for sending and receiving: The size of the message is kept at the beginning of the packet to help check whether the whole message is received or not. This is the method to send message to the clients void Server::send(const QString &message) …

Member Avatar
+0 forum 0

Hello, I am currently trying to use boost asio for IPC. I ran into 2 strange issues: 1) when using the acceptor class, when I bring my process up, I get the error 'Already open' when trying to listen. The port I am trying to bind to is definitely not being used by another process. This only happens for a couple of my processes (others work fine). 2) when trying to establish a connection to a server (one that works fine from above), both processes receive the connection (and also disconnection when I kill one), but when I try to …

Member Avatar
Member Avatar
+0 forum 3

Hello, I have made android application which provides remote desktop administration, I used port 5556 and socket programming TCP. I have to forward this port from router on every computer is there any other way so I can use some open port to communication with android device?? Like TeamViewer doesn't need any extra configuration to run. Regards

Member Avatar
+0 forum 0

Hello! I'm trying to code a C# server for flash apps, and I'm currently working on a broadcast function. When flash clients connect to the server they are added to the connClients list (List<TcpClient>), and with the following function I send the stuff to my flash apps: [CODE] public void sendToClient(String line, TcpClient client) { NetworkStream clientStream = client.GetStream(); ASCIIEncoding encoder = new ASCIIEncoding(); byte[] buffer = encoder.GetBytes(line + "\0"); clientStream.Write(buffer, 0, buffer.Length); clientStream.Flush(); } public void broadcast(String line) { for (int i = 0; i < connClients.Count; i++) { if (connClients[i].GetStream().CanWrite) { sendToClient(line,connClients[i]); } else { connClients.Remove(connClients[i]); myInterface.logTxt.AppendText("Client disconnected."+ …

Member Avatar
Member Avatar
+0 forum 6

Hello I want to know how windows TCP scaling works.I know it performs left shift operation but If we do that wont our data will be lost.

Member Avatar
Member Avatar
+0 forum 3

Hi, I need just simple help. Could you just give me a tip for some good TCP server/client library for Csharp? It should be easy to use, and can handle big data size. Because I was using a Netcomm library, and while sending Image bytes, It has god frozen. Thanks for your help.

Member Avatar
+0 forum 0

Hi, I am developing a critical program for a company. I am not cheking the data which come from socket because I am not using UDP on my program. But can someone tell me please if TCP is exactly %100 secure for data verification. Some cheking algortihms works propely but they are not guaranteed that it works %100. Some of them works %99.9 true (safe). Some algorithms have "margin of error" %0.1 or more or less. I need to be sure if TCP uses %100 secure algorthm for data verification. I will be happy if you answer me by give …

Member Avatar
+0 forum 0

this is my server code i want to receive more than 1000000 bytes ,so the data should be splited into many packets so i use loop to receive all data ,if i use like this server always wait for client even client sent all data to server ,my messsage is terminated with "!",so i want to receive untill "!", do { iByteCount = recv(GetSocketId(), buffer,MAXRECV,0); if ( iByteCount > 0 ) { printf("Bytes received: %d\n",iByteCount); strcat(buf,buffer); } else if ( iByteCount == 0 ) { if(strlen(buf)>0) { //do process with received data } else printf("receive failed"); break; } else printf("recv …

Member Avatar
Member Avatar
+0 forum 1

Why a router does not have only one IP address (i.e. for itself). and why a unique IP address need to be associated with each interface? Whats the scenario which neccessiates each interface to have an IP addresses?(TCP IP)

Member Avatar
Member Avatar
+0 forum 1

Hi, I just want to know which is the best way to transfer files between clients and server. My server is accessed from client through internet. I found some results after googled as using tcp/udp/ftp... So , i just want to know which one is best and why ? . My file size could be around 100MB each , and also i want to setup it for multiple client ...

Member Avatar
Member Avatar
+0 forum 9

my professor provided us with the java program so we could each compile it and run it on our computers. heres what i get: socketProgramming$ java TCPServer <--------name of program - TCP Server program started. - Server welcoming at port #: 6789 im trying to connect to my professors terminal using her IP address but anytime I type anything, it does nothing but show the characters.. please help

Member Avatar
Member Avatar
-1 forum 3

In a client server program ... generally when the server goes down the client on executing the send command 2 times returns a SIGPIPE signal . I want to know y this happens. The client must recieve sigpipe immediately when it sends a message after the socket connection is broken . I have tried many versions of client server programs , when i close the server down , client after it sends 2 messages only is it able to receive a sigpipe signal, shouldn't it be like the cleint receives sigpipe immediately after it sends any msg ??

Member Avatar
Member Avatar
+0 forum 5

heyy guys.. m implementing PEER TO PEER FILE TRANSFER.. What protocol should I use? TCP or UDP? And why?

Member Avatar
Member Avatar
+0 forum 3

Hi everyone :) This is one of my first programs using C, so I am facing some issues. our professer asked us to develop a TCP socket (client/server) where the client sends lets say an ID,Name or Major and the server searches into a txt file and returns the line(s) that contain the info. Example: If Client (user) inputs: Nouf printed to client screen: 20084, Nouf A, Computer Engineering my only problem is that the server only reads the first line. Example: If Client (user) inputs: Computer Engineering only this line is printed (returned from the search function): 20082, Noor …

Member Avatar
Member Avatar
+0 forum 1

Hi, networking is new to me in vb.net as I normally use third party components to do my networking like Winsock Orcas. However I want to make my own classes for networking. The following is what I have so far. It has problems. 1) Its disorganized...particularly the way I'm multi-threading, but this is a learning experience rather than a final product. 2) I need a way to reset the connection on a disconnect. I get a funky error message that tells me I have to call beginconnect on a separate thread, i have to have a different endpoint yada yada. …

Member Avatar
+0 forum 0

Hi, as part of my project, i need to write code that actually implements the tcp layer functions. Could anyone tell me where i could get some idea on how to code the functions of tcp layer (i.e. I need to manage the transfer of data between the network and app layer)

Member Avatar
Member Avatar
+0 forum 3

Hi all, I'm working on a C++ app that needs to communicate with a server. I was wondering if it would be possible to use Java for the Server, and C++ for the Client. I'm assuming it should work (without the use of JNI) because TCP packets are TCP packets, I just have to make sure that both sides know about the packet structure. Thanks

Member Avatar
Member Avatar
+0 forum 3

Hello, I´m currently developing an application which sends data to my Windows server. I already wrote the following code (server-side) [CODE]namespace server { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Server s = new Server(3000); s.ExceptionReceived += new Server.ExceptionReceivedHandler(s_ExceptionReceived); } void s_ExceptionReceived(exception e) { MessageBox.Show(string.Format("DateTime: {0} - UserName: {1} - OperatingSystem: {2} - MachineHash: {3} - Title: {4} - StackTrace: {5}", e.DateTime, e.UserName, e.OperatingSystem, e.MachineHash, e.Title, e.StackTrace)); } protected override void OnClosed(EventArgs e) { base.OnClosed(e); Environment.Exit(0); } } public class Server { private TcpListener listener; public Thread listenthread; public delegate void ExceptionReceivedHandler(exception e); public event ExceptionReceivedHandler …

Member Avatar
Member Avatar
+0 forum 2

A service running in the Server is listening to port 2978 on 1xx.xxx.xx.xx for incoming connections! My PHP code receives URL data through get method. A tcp connection has to be established with the 'service' on that port and the data received from the URL should be sent to the service. The service responds with another data to the same port. this data should be obtained by the code and be saved in a file. I've written the code. But its showing error! help me pls!! [CODE]#!/usr/local/php5/bin/php-cgi <?php $CONTENT = $_GET["DATA"]." "; //fsockopen("tcp://1xx.xxx.xx.xx",2978 , $errno, $errstr, 30); echo urldecode($CONTENT); $Handle …

Member Avatar
Member Avatar
+0 forum 1

I am learning about networking in C# and to do so i am making a simple instant message server/client app. everything is going fine. i am currently testing it by inputting my own ip address as the target to send/receive on same machine. but, i can only send one message then nothing. when i finally give up and exit the app(running it from vstudio) it gives this error: [ICODE]System.InvalidOperationException was unhandled Message=Invoke or BeginInvoke cannot be called on a control until the window handle has been created. Source=System.Windows.Forms StackTrace: at System.Windows.Forms.Control.WaitForWaitHandle(WaitHandle waitHandle) at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean …

Member Avatar
Member Avatar
+0 forum 3

I've trawled the internet searchiing for an explaination on how to do this. I'm working on an assignment and we are told to "transmit a whole object to the server". As far as I know, the send function of winsock2 only allows you to send data of type char, so how can you transmit an object? Is there a way to convert an object to type char and then convert it back to an object the other end? I'm at a loss here!

Member Avatar
Member Avatar
+0 forum 2

i cant connect to my tcp server here is the partial code of my server [CODE]Public Sub New() InitializeComponent() server = New TcpServer(9988) clientCollection = New List(Of System.Net.Sockets.TcpClient)() End Sub[/CODE] and here is for the client [CODE]Try 'connect Dim hostname As String = "127.0.0.1" Dim port As Integer = 9988 client.Connect(hostname, port) connected = True Catch e As Exception running = True MsgBox("Server Offline") End Try[/CODE] its for local only how can i connect if i use another computer thanks.

Member Avatar
+0 forum 0

Hello guys, I need help to divert an application's traffic to a different IP (localhost for example). I heard that this can be added by making the application support sock5? maybe am wrong.. but I just need to divert an application's traffic to my local proxy server. Scheme: iExplorer -> my server -> the webpage it's trying to acces -> my server -> iexplorer hope i'm being clear :)

Member Avatar
Member Avatar
+0 forum 3

Hi, My webserver code is trying to send an image file over a TCP connection. However, the send() function is returning a -1 value with the error: Connection Reset by peer. I am using a web-browser to access the server so my guess is that the server is somehow sending the RST flag to the client which is causing the termination of connection. I am only new to socket programming so I was wondering if you could help me understand the RST packet and how it works. How can I program the server side socket to ensure that the connection …

Member Avatar
Member Avatar
+0 forum 5

Hi, I am writing code for a webserver and am trying to send a html file called index.html over a TCP socket. How would I do this? At the moment I am trying to read the contents of the file and then send them over the connection. However, the page is not being received correctly. I suspect that I am using the wrong function to read and something to do with the data being read as ASCII and not being converted back. But am not sure what else to do =s and cannot find anything online. Please help! while(!feof(sendFile)){ fgets(send_buffer, …

Member Avatar
Member Avatar
+0 forum 6

I am working on a certain project ,and I want to send data from a windows application on a computer to another windows application on another computer , knowing that both computers could be anywhere (not together in a LAN network) ... I heard that it is possible through a TCP or UDP connection ... but I know nothing about them ... Is there a way to make such a connection in Visual C#?? Thank you :)

Member Avatar
Member Avatar
+0 forum 1

Hello, i've a server and client code in which the error i'm getting is: on deserialization- but when i checked the byte[] length after serialization that i send they are 1550, and then over the tcpclient when i received the byte[] it was 1448 in length... any help or suggestion would be appreciated **CLIENT CODE** [code] static void Main() { Application.Run(new Form2connectclient2library()); } public void cmdConnect_Click(object sender, System.EventArgs e) { try { //****************************TCP NETWORK STREAM******* port = Convert.ToInt32(txtPort.Text); ip = txtIPAddress.Text; myclient = new TcpClient(ip, port); recByte = new byte[myclient.ReceiveBufferSize]; AsyncCallback GetMsgCallback = new AsyncCallback(GetMsg); (myclient.GetStream()).BeginRead(recByte, 0, myclient.ReceiveBufferSize, GetMsgCallback, null); …

Member Avatar
Member Avatar
+0 forum 12

The End.