tcp-ip

My SQL server discovery on LAN by listening port (Inno Setup)

拜拜、爱过 提交于 2019-12-19 04:18:05
问题 I need to search for an IP address with Listening Port to look up for others PC on LAN (try to discovery MySQL server) and get the results IP who has that port listening. Something similar to this code to test sockets but working in Inno Setup: program pfinger; uses sockets,errors; Var Addr : TInetSockAddr; S : Longint; Sin,Sout : Text; Line : string; begin Addr.sin_family:=AF_INET; { port 79 in network order } Addr.sin_port:=79 shl 8; { localhost : 127.0.0.1 in network order } Addr.sin_addr

How to reconnect to a socket gracefully

半世苍凉 提交于 2019-12-18 11:27:16
问题 I have a following method that connects to an end point when my program starts ChannelSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); var remoteIpAddress = IPAddress.Parse(ChannelIp); ChannelEndPoint = new IPEndPoint(remoteIpAddress, ChannelPort); ChannelSocket.Connect(ChannelEndPoint); I also have a timer that is set to trigger every 60 seconds to call CheckConnectivity , that attempts to send an arbitrary byte array to the end point to make sure that

Change TCP Payload with nfqueue/scapy

丶灬走出姿态 提交于 2019-12-18 02:57:42
问题 Hello I am using nfqueue and scapy and I my goal is to recieve packets at my NFQUEUE, change the payload and resend them. I can change fields like the TTL without any kind of problem, but when it comes to change the payload, I am encoutering problems. When I change the payload, I sniff the packet with wireshark and apparently I send the packet with the payload modified, but the server doesn't answer. This is my code: #!/usr/bin/env python import nfqueue from scapy.all import * def callback

Set socket timeout in Ruby via SO_RCVTIMEO socket option

核能气质少年 提交于 2019-12-17 10:35:12
问题 I'm trying to make sockets timeout in Ruby via the SO_RCVTIMEO socket option however it seems to have no effect on any recent *nix operating system. Using Ruby's Timeout module is not an option as it requires spawning and joining threads for each timeout which can become expensive. In applications that require low socket timeouts and which have a high number of threads it essentially kills performance. This has been noted in many places including Stack Overflow. I've read Mike Perham's

How can I make a browser to browser (peer to peer) connection? [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-17 01:34:15
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . How can I write a website using HTML5 , CSS and JavaScript on client side that will allow direct tcp/ip connection between the client

Journey of a TCP packet and changes (Ip address and port happens) in every hop

让人想犯罪 __ 提交于 2019-12-14 02:32:13
问题 I'm trying to understand what sort of structural changes happens to the IP packet during the Hop. Allow me to please explain my question with example. traceroute -w 1 google.com traceroute to google.com (216.58.199.174), 64 hops max, 52 byte packets 1 192.168.0.1 (192.168.0.1) 1.055 ms 0.857 ms 0.822 ms 2 10.0.0.1 (10.0.0.1) 2.038 ms 1.477 ms 1.540 ms 3 * * * 4 114.79.130.1.dvois.com (114.79.130.1) 3.091 ms 2.076 ms 2.329 ms 5 10.241.1.6 (10.241.1.6) 3.245 ms 3.102 ms 3.358 ms 6 10.240.254

TCP/IP library (framework) for C# [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-13 09:27:30
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . Is there any asynchronous library for working with TCP/IP on C#? 回答1: .NET has System.Net.Sockets - did you check this out ? 来源: https://stackoverflow.com/questions/7056768/tcp-ip-library-framework-for-c-sharp

How to access TCP Socket via web client

可紊 提交于 2019-12-13 03:03:47
问题 I have a program in an embedded device that outputs an xml string to a socket. The embedded device has lighthttpd has a web server. I want to use a web based client (no flash/silverlight) to connect to the socket and pull the xml data every second. I looked at Node.js with Socket.io to get what I want to do, but I am not clear about how to proceed. Searching through the Node.js and Socket.io documentation and examples I see standard client-server behavior, nothing regarding what I am trying

How do I convert separate int values to hex byte array

徘徊边缘 提交于 2019-12-12 14:58:01
问题 I need to do some (new to me) int/hex/byte work and I am struggling to get it right. The tcp server on the other side is expecting Little Endian. I need to send a byte array consisting of HEX values. 6000 needs to be sent as: 0x70, 0x17 19 needs to be sent as: 0x13, 0x00, 0x00, 0x00 The resulting byte array should look like this. **FROM THE MANUFACTURER** Complete message should be: 0x70, 0x17, 0x13, 0x00, 0x00, 0x00, 0x40, 0x42, 0x0f, 0x00, 0xA0, 0x86, 0x01, 0x00, 0x04, 0x01, 0x02, 0x03,

Unable to do server reconnection after disconnected in C# winform

倖福魔咒の 提交于 2019-12-12 06:25:00
问题 I'm doing an application which require me as a client side to connect to a server and receive data from the server. I will need to do re-connection when the connection is disconnected. Below is my code: public enum MySocketState { Disconnected = 0, Connecting, Connected } private Socket _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); private byte[] _recieveBuffer = new byte[128]; void DataProcess() { try { if (_serverSocket == null || sockState ==