sockets

Do AIR applications run in a trusted sandbox?

I have an AIR application that is packaged with a network appliance and that is used to configure that network appliance...much like a the embedded webservers on home routers except this is an installed AIR app. If I want to communicate with the appliance on a port higher that 1024, do I need that appliance to serve up a socket policy f...

What VB6 socket component can reuse bound ports?

I'm updating legacy code written in VB6 using Winsock controls. Essentially, I'm trying to connect 4 computers across a local network such that the computers can share files between each other when needed. Originally, once a connection was established, they held onto them indefinitely. These would error after 12-24 hours, however, and co...

TcpListener Timeout/about/something? Without ASync?

I create a thread which uses TcpListener and when my app closes i'd like the thead to terminate. I can call abort but the thread is still alive since TcpListener is blocking with AcceptTcpClient. Is it possible to about or set a timeout or to do SOMETHING with AcceptTcpClient? i cant imagine how it would be useful if theres no way to st...

Identify C++ Socket port number

Ok, so I can create a socket and send a message to a remote machine (UDP btw). My problem is that I need to know what port I sent the message on. The remote machine is going to respond on the same port that I sent from. Right now it seems to be picking random high ports, like 46555. Is there a way to specify what port it goes out on or i...

What causes TcpListener Socket Error 10013?

I get error 10013. msdn says its a permission denied error. An attempt was made to access a socket in a way forbidden by its access permissions My app ran fine. I then made a code change and restarted it. I got that error. I suspected i have to reuse ports so i wrote this in and still had no luck server.Server.SetSocketOption(SocketO...

How do I close a socket or an I/O Stream in the windowClosing event of a Java window?

I'm having trouble closing my socket when exiting my Java application. I thought that an easy way to make sure the socket gets closed is to hook it on windowClosing in a Swing JFrame like this: frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { input.close(); out...

Data actualization

I created a class called DataManager and within it I called Calendar.getInstance(), this class is running on a server with exchange of sockets, but every time you change a socket, the date is never updated, it always displays the same date as the date when the class was instantiated the first time. I would have to create a thread only to...

Port confusion (breaks my .NET code)

Using netstat i found this in my list TCP 127.0.0.1:9832 My-PC:9832 ESTABLISHED My question is how is my local port outgoing AND CONNECTED to the same TCP port? This is breaking my code because i am listening to port 9832. I am getting a permission error. I need to lose firefox and reopen all my tabs before this...

How do i handle clients better with TCPListener?

I had a problem with too many connections After a few test i deducted the problem is with MY server. The fact that the server listening port was on the left side should have told me. When running the same client code using a server on a different machine i dont get hundreds of ports opened. When my server on my local machine i get > 200...

How to pass xml data between c# and java sockets

Hi All, I have a c# server and a java client. Currently they pass plain text between each other using sockets. Now I want to change these sockets to communicate in XML. I can implement the java side, But i do not know how to implement the c# server side so that the server and the client could communicate without any problem. Are there an...

how to get client IP using socket programming c#

Hi, is there anyone who know that how to get client ip using socket programming while we are requesting the access of file transfering??i am using C# thanks ...

Html5 Websockets - What should I know about sockets before using websockets

I'm currently experimenting with html5 and websockets. I know next to nothing about "ordinary" sockets. Before messing about with websockets I think it might be wise to learn about sockets. Is there any online material that I should read or excersizes that I should go through to get myself up to speed? It might be worth pointing out tha...

Socket client/server input/output polling vs. read/write in linux

Basically I set up a test to see which method is the fastest way to get data from another computer my network for a server with only a few clients(10 at max, 1 at min). I tried two methods, both were done in a thread/per client fashion, and looped the read 10000 times. I timed the loop from the creation of the threads to the joining of ...

How can I get an error stream over a socket in Java?

I'm currently writing something to work around this Java bug: http://bugs.sun.com/view_bug.do?bug_id=5049299 Basically, I've got a light weight C server that runs on the same machine as the Java server. I'm adding a feature to the C server when I can request it to fork/run a new process via a socket and pass back stdin/stdout/stderr. ...

php socket server disconnecting

I'm trying to set up a socket server in php that stays open. This example taken from php.net will close after it receives connection...even after I comment out socket_close($spawn) <? // set some variables $host = "192.168.1.109"; $port = 1234; // don't timeout! set_time_limit(0); // create socket $socket = socket_create(AF_INET, SOCK_S...

Multipe Send()'s and Recv()'s using Winsock2

Hello, I am working on a small networking project using Winsock2. I am using a TCP connection and actually am working with IRC as an example since IRC is fairly simple. What I am doing is connecting to the server and sending an initial buffer so the server recognizes a connection. This works fine. What concerns me is that I cannot writ...

How do I connect to a UDP port in Python?

Like everyone else, I can say "I've tried everything!" I kind of did. I looked all over StackOverflow, and tried all the answers, but got nothing. Anyways, I am jetting to at least get some code printed by Python before I get even further in developing this. I want to receive UDP packets from my Garry's Mod server (logaddress_add MyIP:7...

Accept() function; Simple tcp server in C

I'm learning socket programming in C & downloaded a simple tcp server source file. I understand every line except the 2nd parameters in these functions: accept(socket_fd, (struct sockaddr *)&client, &length); bind(socket_fd, (struct sockaddr *)&server, length); The accept + bind functions are the typical functions in "sys/types.h" & ...

why select() always return 0 after the first timeout

I have a problem about select function when I worked on a Linux socket program. The select function worked fine as the man page says if the client connected the server side in the time interval configured by the server. If the timeout happened, the select function will return 0 forever. At that time, I debug the client and find the clie...

Unix Domain Socket: Using datagram communication between one server process and several client processes

I would like to establish an IPC connection between several processes on Linux. I have never used UNIX sockets before, and thus I don't know if this is the correct approach to this problem. One process receives data (unformated, binary) and shall distribute this data via a local AF_UNIX socket using the datagram protocol (i.e. similar t...