sockets

UDP broadcast of WCF Service address

Im have a lab-environment in VMware with a WS2008R2-server and a W7-client. Im trying to broadcast a WCF-service-address from the server and receive this in the client. Im using System.Net.Sockets in C# .NET and I can successfuly send data from the server. I looks okay with WinDump at least. But when I try to receive this on the client i...

How to transfer a file in a client/server Java application.

Hello everyone! I am currently working on a homework assignment and I am thoroughly stuck. I am on the last question and I just can not figure out how to go about accomplishing the last task. Below is the tasks I had to complete: The client should save the file in the "client" subdirectory of the home directory. Test your program....

Linux socket programming testing

I am new to socket programming and I have written a code for the server using the epoll. Basically it would wait to accept for any client connection and it would send data to the clients if the data is available from other sources. I need to test on how is the performance of the server when there are multiple requests for the connectio...

get client IP in socket programming in PHP

I'm using PHP to write a using socket library application. How could I get the IP of the client? THanks for any help ...

node.js: Enumerating socket clients...

Hi, I'm trying to create a server app in node.js, where multiple clients connect, and then one sends data, and that data gets send to another specific client. Which client it gets sent to is determined by a 'user id' that all clients will send after they connect. How can I keep track of clients as they connect? How can I find my specif...

Copying binary file changes newline character to window's standard..? Java

Hello everyone! For some reason, this code is changing any '\n' characters from the input and replacing it with '\n\r' in the new outputed file. I reference a couple websites, and still haven't figured it out.. Anyone have an idea? Thanks a lot! Socket connectionSocket = sData.accept(); InputStream inputStream = connectionSocket.getInp...

How to avoid UDP socket transfers limits?

Hi all, I write a little program that sends file from client to server trough udp socket connection.. the program works correctly but if the file I transfer is larger than 8192 kb the stream stops and the file I receive is corrupt.. How can I avoid this limitation? server.py host = ... port = ... filename = ... buf = 2048 addr = (host...

Java: Reading from ObjectInputStream

I have only started learning Java. My task is to create a file server which accepts certain commands like File Get, File Put and File Delete from multiple clients using Threading. I am using a custom class DataObject to serialize and send commands and any data that may accompany with it. The client is to be made interactive in the sense ...

SSL connection in Flash socket?

Is it possible to establish an SSL connection from a Socket in Flash? ...

Access Android activity stack from asynchronous thread?

There are a ton of activity stack related questions on StackOverflow, but I didn't really see any that answered the question I have. I'm working on an online game that (for now) has 3 different activities: Login/Register Menu (seen when logged in, includes "new game", "my stats", and a few other things...I'm just worried about the "ne...

How to create IPv6 socket at python? Why got the socket.error: (22, 'Invalid argument') ?

I want to ceate Ipv6 socket at python, I do it like this: #!/usr/bin/env python import sys import struct import socket host = 'fe80::225:b3ff:fe26:576' sa = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) sa.bind((host , 50000)) But it failed: socket.error: (22, 'Invalid argument') ? Can anyone help me? thanks! I redo it like t...

C# - Server-side password protection

Hi there, I am writing two console applications, a client and a server. I'm a little stuck at two things, which seemed rather easy at first.. #1: I want to write a function for the following piece of code, that converts bits to a string, but I cant just figure it out. The server always crashes when I use it. My function is a little bit...

Is there a way I can add Java Web Start service inside my server which uses my own TCP-based-protocol ??

I am building an applicaton in Java that will have some updates over time. This means that the client will have to download a new .jar and use it when available. I read about jws (java web start) and it works fine. But the problem is that my application uses a protocol I created, and it will just be able to connect to my server. It may n...

What are some applications that I can develop using winsock apart from chat and file sharing applications?

I am new to socket programming and I am looking for more info about what I can do with winsock. ...

Set timeout on getaddrinfo() in Python

Is it possible to set a timeout on a getaddrinfo() call in CPython 2.7? socket.setdefaulttimeout() does not work. I don't really want a solution that wraps a function using threads or signals. A solution that only uses the standard library is best, but using a third-party package would be acceptable. For example, I want to do this: ...

Socket VLI (Variable Length Indicator)

I have been programming with sockets for a long time and one of the things I always do is include a vli (variable length indicator) at the beginning of a message. The vli is useally 2 or 4 bytes and indicates how long the message is. The idea is that if two messages come in together you can split them apart. If a messages spans multiple ...

Java XML SAXParser throws NullPointerException on method .parse(InputSource,XMLCommandsHandler)

I get a very misterious NullPointerException when parsing a stream comming from a socket with jdk's javax.xml.parsers.SAXParser. My InputSource is a RecordingInputStream that I created by extending FilterInputStream in order to be able to record in a log file all the data that I receive on the socket before it goes down to the parser. B...

When send() returns in socket programming, what does that mean?

when send() returns, there are three possibilities: 1. the data to sent has been copied to the kernel buffer 2. the data to sent has been sent to peer 3. the data to sent has been sent to peer and received its ack Being really confused, I read some pieces of code about TCP/IP stack in Linux source, and I found the path of the data st...

java.net.SocketException while creating https conenction, javax.net.ssl.DefaultSSLSocketFactory.createSocket

Hi All, I am trying to create a https connection and its working fine in a test class.but when i call the same method in action class its getting following error after step 666666666666. java.net.SocketException at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:8) at com.ibm.net.ssl.www2.protocol.https.b.after...

Socket/threading problem: The Undo operation encountered a context that is different from what was applied in the corresponding Set operation

Hi, I'm having problems with the above much asked-about error. We have a TCP/IP server application which has been working fine for some years. I now need to allow the application to accept connections from directly connected USB devices, by internally using a socket connection to patch through to localhost (127.0.0.1) within the server...